PredefinedFiltersElement Class

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

Namespace: DevExpress.Xpf.Core.FilteringUI

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

Declaration

public class PredefinedFiltersElement :
    FilterElement
Public Class PredefinedFiltersElement
    Inherits FilterElement

Remarks

TIP

Topic: Filter Elements

TIP

Demo: Predefined Filters

Requires a WPF Subscription. Download

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