Skip to main content

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

image

How to: Enable the Classic Style

Use the following properties to enable the Classic style:

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:

Use the following events to customize the menu:

A column’s filter settings override the corresponding tree list settings. The TreeListColumn.OptionsFilter property provides access to a column’s filter settings.

Formatted Column Values: Filters Correspond to Actual Values or Displayed Text

Each filter in the menu corresponds to an actual value in the column.

TreeListColumn_FilterMode_Regular

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.

TreeListColumn_FilterMode_Regular_Formatted

To resolve this issue, set the TreeListColumn.FilterMode property to DisplayText.

bcSalesDate.FilterMode = XtraGrid.ColumnFilterMode.DisplayText;

In this mode, each filter corresponds to multiple actual values that have the same textual representation.

TreeListColumn_FilterMode_Display_Formatted

See Also