Skip to main content

PredefinedFiltersElement Class

A filter element that works with a column’s Predefined Filters.

Namespace: DevExpress.Xpf.Core.FilteringUI

Assembly: DevExpress.Xpf.Grid.v23.1.dll

NuGet Package: DevExpress.Wpf.Grid.Core


public class PredefinedFiltersElement :



Topic: Filter Elements

Run Demo: Predefined Filters

Starting from v18.2, the GridControl supports Predefined Filters. Use the ColumnBase.PredefinedFilters property to specify them:

<dxg:GridColumn FieldName="MPGCity">
            <dxfui:PredefinedFilter Filter="?p >= 25" Name="More than 25" />
            <dxfui:PredefinedFilter Filter="?p >= 15 AND ?p &lt; 25" Name="From 15 to 25" />
            <dxfui:PredefinedFilter Filter="?p &lt; 15" Name="Less than 15" />

The PredefinedFiltersElement allows a user to apply a column’s predefined filters:

<dxg:GridControl x:Name="grid" ... />
<!-- ... -->
<dxfui:PredefinedFiltersElement Context="{Binding FilteringContext, ElementName=grid}" FieldName="MPGCity" /> 

FilterModelTemplate Property

Use the FilterElement.FilterModelTemplate property to specify the filter element template.


Data Context (Binding Source): PredefinedFiltersModel

ShowCounts Property

You can set the FilterElement.ShowCounts property to false to not show the record count next to filter values.

See Also