tags:

views:

13

answers:

1

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?

A: 

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();
}
Veer