views:

37

answers:

2

I bind a dataset to a datagrid wpf like this

    DataSet d = Database.getBabies();
            babies = d.Tables[0].DefaultView;
      dataGridBabies.ItemsSource=babies;

Which is the best way to filter the data?(without running database query)

A: 

You can filter data with use of CollectionViewSource. See here for reference

For More Detailed Explanation

saurabh
+1  A: 

In XAML:

<CollectionViewSource x:Key="MySource" Source="{Binding Path=MyDataBase}" Filter="OnCollectionViewSourceFilter">
testalino
an example please?
Parhs