开发者

Syntax help required

开发者 https://www.devze.com 2023-02-15 15:10 出处:网络
Can someone help with the following: CollectionView.Filter = m => ((Custome开发者_JAVA技巧r)m).Name.ToLower().Contains(_lastNameFilter);

Can someone help with the following:

CollectionView.Filter = m => ((Custome开发者_JAVA技巧r)m).Name.ToLower().Contains(_lastNameFilter);

Instead of looking up name, I'd to search DateAdded = _filterDate


I don't know how CollectionView.Filter works, but why don't you just use this:

CollectionView.Filter = m => ((Customer)m).DateAdded == _filterDate;


It looks like it should be:

CollectionView.Filter = m => 
    ((Customer)m).DateAdded == DateTime.Parse(_filterDate);


With the assumption that _filterDate is a string and DateAdded a Date CollectionView.Filter = m => ((Customer)m).DateAdded == DateTime.Parse(_filterDate);

0

精彩评论

暂无评论...
验证码 换一张
取 消