Filter Editor
- 2 minutes to read
The Filter Editor allows end users to build filter criteria. End users can add filter conditions and use logical operators to group them.
Set the DataViewBase.AllowFilterEditor property to true to allow end users to invoke the Filter Editor.
Note
- FilterControl - a standard filter editor.
- FilterEditorControl - a new filter editor (CTP). The GridControl supports it starting from v18.2. To use this filter editor, set the DataViewBase.UseLegacyFilterEditor property to false.
Invoke the Filter Editor
End users can invoke the Filter Editor in the following ways:
Right-click the column’s header and select Filter Editor…:
Click in the Filter Panel:
In code, call the DataViewBase.ShowFilterEditor method to invoke the Filter Editor. You can handle the DataViewBase.FilterEditorCreated event to customize the Filter Editor before it is displayed.
Filter Editor UI
The Filter Editor displays filter criteria as a tree structure where nodes are filter conditions. The Filter Editor groups filter conditions by logical operators if the filter criteria consist of several filter conditions.
Example 1
The following image displays the Filter Editor with the “[Product] = ‘Chang’ And [Quantity] > 20” filter expression:
Example 2
The image below displays the Filter Editor with the “([Product] = ‘Chang’ And [Quantity] > 20) Or ([Product] In (‘Tofu’, ‘Konbu’) And [Quantity] < 100)” filter expression:
The filter expression contains two groups combined by the logical Or operator. You can consider groups as clauses wrapped by round brackets in the filter expression.
Filter Editor Elements
The image below describes the Filter Editor‘s elements:
Tip
The Filter Editor supports localization. Refer to the Localization topic for more information.
Allowed Group Filters
You can use the DataViewBase.AllowedGroupFilters property to specify the allowed group filters.
Example 1
<dxg:TableView AllowFilterEditor="True" AllowedGroupFilters="None" />
The Filter Editor does not allow you to add groups. You can add only one node in the root group:
Example 2
<dxg:TableView AllowFilterEditor="True" AllowedGroupFilters="And,Or" />
You can add only groups with the specified type:
Note
- The Filter Editor allows you to select only criteria operators that are available for the current column.
- The Filter Editor allows you to select only columns that have allowed operators.
Refer to the Allowed Filters topic for information on how to specify these filters.