开发者

Check for the existence of a value in a WPF datagrid

开发者_开发问答

I want to retrieve data from WPF datagrid depending on certain condition. But the problem is, I am not sure if the data exist. How to check it?


Hope you've some Collection or List bound to the datagrid. If so you can query it like this:

var query = yourList.Where(item => item.Name = "abc" ); // retrieve items having Name 'abc'

var retrievedItems;
if(query.Any)
{
    retrievedItems = query.ToList();
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜