I have a DataGrid that needs to be filtered programatically. I populate the dependency grid with a ItemsSource with all my data in it. When I select an item in a parent grid, I want this grid to filter showing the one or many dependency items.
So, I'd figured out I can clear the FilterDescriptorCollection and add items to it in using this syntax. Note FilterSettings = FilterDescriptorCollection:
aggregationGridView.FilterSettings.Clear();
foreach (AggregateDD child in aggregate.ChildList)
{
FilterDescriptor filter = new FilterDescriptor(
"AggregateID", FilterOperator.IsEqualTo, child.AggregateID);
aggregationGridView.FilterSettings.Add(filter);
}
However, this seems to write a query that as AND instead of OR. This is more the query I'd like to run:
( (AggregateID IsEqualTo 385 MC) OR (AggregateID IsEqualTo 386 MC) OR (AggregateID IsEqualTo 387 MC) OR (AggregateID IsEqualTo 388 MC) )
How do I add a new FilterDescriptor to the FilterDescriptorCollection as an OR?
Thanks for your help.