Classic Style
- 3 minutes to read
Overview
The Classic-style filter menu depends on a column’s data type:
- a calendar for the date-time values
- a list (or a checklist) for other data types
How to: Enable the Classic Style
Use the following properties to enable the Classic 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. This property allows you to specify the exact Classic mode: list, checklist, or calendar.
Note
Excel is the default style since v17.1. You can also set the static WindowsFormsSettings.DefaultSettingsCompatibilityMode field to v16 to enable the Classic style. See Version Compatibility for more information.
Options
The TreeList.OptionsCustomization.AllowFilter property specifies whether users can use pop-up filter menus and filter panel. This property does not affect your capability to filter data in code.
The TreeList.OptionsFilter property provides access to the following settings related to the Classic style:
- ColumnFilterPopupRowCount — Gets or sets the maximum number of values in the pop-up filter menus.
AllowColumnMRUFilterList — Gets or sets whether the pop-up filter menus display the most recently used filter list.
MRUColumnFilterListCount — Gets or sets the maximum number of items in the pop-up filter menu‘s most recently used filter list.
- ShowAllValuesInFilterPopup — Gets or sets whether the value list in the pop-up filter menu shows all available values or only those that are currently displayed in the column.
- ShowAllValuesInCheckedFilterPopup — Gets or sets whether the value checklist in the pop-up filter menu shows all available values or only those that are currently displayed in the column.
Use the following events to customize the menu:
- TreeList.ShowFilterPopupListBox — Fires before a pop-up filter menu is displayed. Allows you to customize the value list.
- TreeList.ShowFilterPopupCheckedListBox — Fires before a pop-up filter menu is displayed. Allows you to customize the value checklist.
A column’s filter settings override the corresponding tree list settings. The TreeListColumn.OptionsFilter property provides access to a column’s filter settings.
- AllowFilter — Gets or sets whether users can filter data against this column using the pop-up filter menu and filter panel.
- FilterBySortField — Gets or sets whether the TreeListColumn.FieldNameSort or TreeListColumn.FieldName property specifies the data source field that provides values for the pop-up filter menu.
- ImmediateUpdatePopupDateFilter — Gets or sets whether a filter condition selected in the pop-up filter menu‘s calendar applies immediately.
- ShowBlanksFilterItems — Gets or sets whether the value list and value checklist in the pop-up filter menu contain the (Blanks) and (Non Blanks) filter conditions.
- ShowEmptyDateFilter — Gets or sets whether the calendar in the pop-up filter menu contains the Show Empty filter condition.
Formatted Column Values: Filters Correspond to Actual Values or Displayed Text
Each filter in the menu corresponds to an actual value in the column.
You can use the TreeListColumn.Format property to format cell values. For instance, you can show only a four-digit year in date-time values.
bcSalesDate.Format.FormatType = Utils.FormatType.DateTime;
bcSalesDate.Format.FormatString = "yyyy";
When values are formatted, filters are also displayed according to the specified format. In certain cases, this displays the same filter for different values.
To resolve this issue, set the TreeListColumn.FilterMode property to DisplayText.
In this mode, each filter corresponds to multiple actual values that have the same textual representation.