Excel-style Drop-down Filter
- 2 minutes to read
The GridControl provides an Excel-style drop-down filter. You can enable this drop-down filter for:
- A column by setting the column’s ColumnBase.FilterPopupMode property to FilterPopupMode.Excel.
- All the columns by setting the DataViewBase.ColumnFilterPopupMode to ColumnFilterPopupMode.Excel.
Filter Rules Tab
The Filter Rules tab displays filter conditions allowed for the current column:
If a filter criterion is disabled, the rules’ list hides the corresponding item. The Filter Rules tab is hidden if the rules’ list is empty. Refer to the Allowed Filters topic for more information.
Filter Values Tab
The Filter Values tab provides an Excel-style checklist:
For non-nullable date-time columns in ColumnFilterMode.Value mode:
- If AllowedDateTimeFilters.MultipleDateRanges is disabled, the Filter Values tab is hidden.
For nullable date-time columns in ColumnFilterMode.Value mode:
- If AllowedDateTimeFilters.MultipleDateRanges is disabled, the Filter Values tab displays only the Blanks item when it exists in a datasource.
- If AllowedUnaryFilters.IsNullOrEmpty is disabled, the Blanks item is hidden, only unique values are displayed.
- If AllowedDateTimeFilters.MultipleDateRanges and AllowedUnaryFilters.IsNullOrEmpty are disabled, the Filter Values tab is hidden.
For non-nullable non-date-time columns:
- If AllowedAnyOfFilters.AnyOf is disabled, the Filter Values is hidden.
For nullable non-date-time columns and date-time columns in ColumnFilterMode.DisplayText mode:
- If AllowedAnyOfFilters.AnyOf is disabled, the Filter Values tab displays only the Blanks item when it exists in a datasource.
- If AllowedUnaryFilters.IsNullOrEmpty is disabled, the Blanks item is hidden, only unique values are displayed.
- If AllowedAnyOfFilters.AnyOf and AllowedUnaryFilters.IsNullOrEmpty are disabled, the Filter Values tab is hidden.
Built-in Smart Search
The Excel-style filter provides a search box that allows your end-users to find filter values:
Smart Excel Drop-down Filter
Starting from v18.2, the GridControl supports the smart Excel drop-down filter. You can enable this drop-down filter for:
- A column by setting the column’s ColumnBase.FilterPopupMode property to FilterPopupMode.ExcelSmart.
- All the columns by setting the DataViewBase.ColumnFilterPopupMode to ColumnFilterPopupMode.ExcelSmart.
This drop-down filter is similar to the Excel drop-down filter and offers the following advantages:
Supports Predefined Filters.
Displays record count next to distinct values.