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 |
---|---|
Smart, if the TreeList is contained in a TreeListLookUpEdit; Extended, otherwise (Standard for version 16.1 and older). | |
Shows parent nodes that do not fit the filter. | |
Does not show parent nodes that do not fit the filter. | |
Shows parent and child nodes that do not fit the filter.
| |
Nodes that match the applied filter are only displayed if their parent nodes also fit the filter. If a node fits the filter, but any of its parent nodes do not, the node is not displayed. |
Note
Try out filter modes on the Filter Options tab in the XtraTreeList demo.