[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Views
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Grouping
   [Collapse]Filtering and Searching
    [Expand]Drop-down Filter
     Automatic Filter Row
     Filter Editor
     Filter Elements
    [Expand]Filtering in Code
     Predefined Filters
     Data Analysis Filters
     Conditional Formatting Filters
    [Expand]Search
   [Expand]Sorting
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus, Navigation, Selection
   [Expand]Drag-and-Drop
   [Expand]Conditional Formatting
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]Miscellaneous
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Filter Elements

You can use Filter Elements to filter the GridControl / TreeListControl's data. Filter Elements are separate controls within your application that automatically retrieve available values, format settings, and other information from the bound control.

Using Filter Elements, you can build your own UI to filter control data. As an example, here is a UI that uses Filter Elements for a filtering panel displayed next to the GridControl:

Tip

Demo: Filtering UI

Requires installation of WPF Subscription. Download

Expanded Create a Filter Element

  1. Add a filter element (the FilterElement (see FilterElement) class descendants) to the markup.
  2. Set the attached FilterElement.Context property to associate the filter element with the GridControl's filter context.
  3. Specify the field name of the column you want to filter using the FilterElement.FieldName property.

The following code sample uses the CheckedListFilterElement (see CheckedListFilterElement) to filter the GridControl's data by the City column values:

The image below shows the result:

Expanded Filter Element Types

Tip

Demo: Filtering

Requires installation of WPF Subscription. Download

Filter Element

Image

Description

CheckBoxFilterElement

Allows a user to filter by boolean values.

<dxfui:CheckBoxFilterElement FieldName="HasAttachment" />

RadioListFilterElement

Allows a user to select one filter value from a set.

<dxfui:RadioListFilterElement FieldName="Doors" />

CheckedListFilterElement

Allows a user to select multiple filter values from a set.

<dxfui:CheckedListFilterElement FieldName="TrademarkID" />

CheckedTreeListFilterElement

Allows a user to filter by hierarchical values.

<dxfui:CheckedTreeListFilterElement FieldName="SalesDate" />

PredefinedFiltersElement

Allows a user to apply a column's Predefined Filters. Use the ColumnBase.PredefinedFilters property to specify predefined filters.

<dxfui:PredefinedFiltersElement FieldName="MPGCity" />

FormatConditionFilterElement

Allows a user to apply a column's Conditional Formatting Filters. Use the TableView.FormatConditions / TreeListView.FormatConditions property to define conditional formatting rules.

<dxfui:FormatConditionFilterElement FieldName="UnitPrice"/>

RangeFilterElement

Allows a user to filter by numeric values.

<dxfui:RangeFilterElement FieldName="Price" />

DateRangeFilterElement

Allows a user to specify a date interval.

<dxfui:DateRangeFilterElement FieldName="SalesDate" />

CalendarFilterElement

Allows a user to filter by date values.

<dxfui:CalendarFilterElement FieldName="SalesDate" />

DatePeriodsFilterElement

Allows a user to apply predefined date filters.

<dxfui:DatePeriodsFilterElement FieldName="SalesDate" />

MultiFilterElement

Allows a user to choose filter conditions.

<dxfui:MultiFilterElement FieldName="SalesDate" />

ExcelStyleFilterElement

Consists of two tabs. The first tab allows a user to apply filter conditions. The second tab provides an Excel-style checklist.

<dxfui:ExcelStyleFilterElement FieldName="Employee" />

Is this topic helpful?​​​​​​​