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.v24.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public class PredefinedFiltersElement :
    FilterElement

Remarks

Tip

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">
    <dxg:GridColumn.PredefinedFilters>
        <dxfui:PredefinedFilterCollection>
            <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" />
        </dxfui:PredefinedFilterCollection>
    </dxg:GridColumn.PredefinedFilters>
</dxg:GridColumn> 

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.

Tip

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