Back to Devexpress

How to: Apply a Filter to a Field

wpf-8036-controls-and-libraries-pivot-grid-examples-grouping-filtering-and-summarizing-how-to-apply-a-filter-to-a-field.md

latest937 B
Original Source

How to: Apply a Filter to a Field

  • Aug 01, 2019

This example shows how to apply a filter to a field.

The first filter selects records which contain UK in the fieldCountry field, the second filter selects four categories in the fieldCategoryName field: Beverages, Condiments, Seafood, and Produce.

csharp
fieldCountry.SetFilterValues(new string[] { "UK" }, FieldFilterType.Included, true);
    fieldCategoryName.SetFilterValues(new string[] { "Beverages", "Condiments", "Seafood", "Produce" }, FieldFilterType.Included, true);
vb
fieldCountry.SetFilterValues(New String() { "UK" }, FieldFilterType.Included, True)
    fieldCategoryName.SetFilterValues(New String() { "Beverages", "Condiments", "Seafood", "Produce" }, FieldFilterType.Included, True)