Setting Filters Programmatically (composite descriptors)
Using CompositeFilterDescriptor
To filter a single data field by multiple values, you have to use the CompositeFilterDescriptor object. It contains a collection of filter descriptors objects and the logical operator for that filters.
Setting composite filter descriptors
The CompositeFilterDescriptors supports And and Or logical operators. Result of the above example using And logical operator:
Result of the above example using Or logical operator:
More Complex Composite Filters
The composite filters allow you to create more complex filtering expressions. Such a complex filtering expression might include filters for multiple fields combined with different logical operators, like (UnitsOnOrder= 0 AND (UnitsInStock> 100 OR ProductName.StartsWith(“G”))).
Setting complex composite filter descriptors
Setting Filters for Excel-like filtering
The following example shows how you can add descriptors that will be reflected in the Excel-like filter popup.