Pop-up Filter Menus
- 2 minutes to read
Overview
The filter button in a column header invokes a pop-up filter menu.
Note
Run the XtraTreeList demo to try out pop-up filter menus.
To disable pop-up filter menus, use the TreeList.OptionsCustomization.AllowFilter property. To disable this feature for a particular column, use the TreeListColumn.OptionsFilter.AllowFilter property.
To invoke a pop-up filter menu in code, use the TreeList.ShowFilterPopup method. The TreeList.ColumnFilterChanged event fires when a column’s filter changes.
Styles: Excel and Classic
Pop-up filter menus support two styles:
Excel — the menu contains two tab: a value checklist and data-specific . See Excel Style for more information.
Classic — the menu contains a value list or a calendar depending on the data type. See Classic Style for more information.
To specify the menu style:
- for all tree lists in the application — use the static WindowsFormsSettings.ColumnFilterPopupMode property
- for a tree list — use the TreeList.OptionsFilter.ColumnFilterPopupMode property
- for a column — use the TreeListColumn.OptionsFilter.FilterPopupMode property
Filter Modes
The TreeList.OptionsFilter.FilterMode property specifies whether to show only the filtered nodes or also show their parent and child nodes. You can also hide nodes that have parents that do not match the filter criteria. The following modes are available:
Mode | Description |
---|---|
| Equivalent to ‘ParentBranch’ mode. |
| Shows parent and child nodes that do not fit the filter. |
| Shows nodes that match the filter along with node parents (even if they do not fit the filter). |
| Shows nodes if they and all their parents match the filter.
If a node fits the filter but any of its parents does not, the node is not displayed. |
| Shows only those nodes that match the filter. If a node is collapsed, its children are hidden even if they match the current filter. Enable the TreeListOptionsFilter.ExpandNodesOnFiltering option to automatically expand collapsed nodes before filtration. |
| Obsolete; equivalent to |
| Obsolete; equivalent to |
| Obsolete; equivalent to |
Note
Try out filter modes on the Filter Options tab in the XtraTreeList demo.