I have a window that displays a DataGrid in C# WPF. Each line of the datagrid is a Custom object. Inside my XAML datagrid definition I map the properties of the custom object to the columns of the DataGrid.
For Example
<DataGrid Name="Mydg">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Path=p1}" Header="Prop1"/>
<DataGridTextColumn Binding="{Binding Path=p2}" Header="Prop2"/>
</DataGrid.Columns>
</DataGrid>
I create the window like this:
ObservableCollection<Custom_Object> records = new ObservableCollection<Custom_Object> { }; //A list of objects to display
records.Add(cust_obj1);
records.Add(cust_obj2);
CollectionView view = new CollectionView(records);
Custom_Window a_win = new Custom_Window();
a_win.Mydg.ItemsSource = view;
Now I need to implement a filter or rather a powerful query mechanism using plain SQL input. I have done this previously using
DataTables.RowFilter
property and providing an SQL like string typed by the user. However for my case above I only seem to be able to make a filter using a predicate which (to my limited knowledge of the language) can be used only for static and simple filtering.
Is there a quick way to implement an SQL like querying mechanism in my case?