Skip to main content

Filter Dropdown

  • 3 minutes to read

Similar to filter dropdowns for the filter panel, filter dropdowns for View items (or simply filter dropdowns) are one of the alternative ways end-users have for filtering the data displayed by a grid View. End-users can invoke them using filter dropdown buttons. Selecting an item from a filter dropdown, changes the current grid View’s filter criteria appropriately.

VCL Data Grid: A Filter Drop-Down Window Example

Feature

Related Members

Availability

A filter dropdown is available to end-users provided that a column, card row, or data item displays its filter dropdown button.

Content

Most Recently Used List

By default, filter dropdowns display a list of the most recently used items at their top. You can disable these MRU lists by setting the desired column’s or card row’s Options.FilteringMRUItemsList property to False. If you need to disable MRU lists for all filter dropdowns in a grid View, set the desired Table View’s Filtering.ColumnMRUItemsList property (or the Filtering.RowMRUItemsList property for a Card View) to False. The maximum MRU list’s length is specified by the View’s Filtering.ColumnMRUItemsListCount property (the Filtering.RowMRUItemsListCount property for a Card View).

Predefined Items

By default, filter dropdowns display the (All) and (Custom…) items allowing you to clear filtering by the field’s values and display a Custom Filter dialog respectively. Additionally, if a field contains null values, the filter dropdown displays the (Blanks) and (NonBlanks) items that allow you to filter by null and non-null values, respectively. You can remove any of the predefined items by handling the View’s DataController.Filter.OnGetValueList event or a particular item’s OnGetFilterValues event.

Note

For date/time values, you can control the items to be created as specified via the View’s DateTimeHandling.Filters property.

User-Defined Items

You can extend the default values list with manually created items that correspond to the most commonly used filtering tasks performed by your application’s end-users. To do so, handle the View’s DataController.Filter.OnGetValueList event or a particular grid item’s OnGetFilterValues event. Both these events enable you to add custom filter items to filter lists. To apply filter criteria associated with these filter items, handle the grid item’s OnUserFiltering and OnUserFilteringEx events.

Value List

A filter dropdown’s bottom part contains a list of the unique values in the corresponding field. You can customize this list by handling the two events mentioned earlier. This may be useful for instance, if you need to provide only the manually created items and remove all value items from the list.

Note

you can customize the text representing each item within the filter dropdown by handling the desired item’s OnGetFilterDisplayText event. The text specified will also be used to construct the filter string displayed within the filter panel.

Layout

For tabular Views, the dropdown list’s width is specified by the View’s Filtering.ColumnPopup.DropDownWidth property (corresponds to the View’s Filtering.RowPopup.DropDownWidth property for Card Views).

For tabular Views, the list’s height is specified by the View’s Filtering.ColumnPopup.MaxDropDownItemCount property (corresponds to the View’s Filtering.RowPopup.MaxDropDownItemCount property for Card Views), which sets the maximum number of filter items that can be displayed simultaneously. If the actual number of items exceeds the specified value, the dropdown list displays a vertical scrollbar.

Behavior

Use a View item’s Options.FilteringPopupIncrementalFiltering property to enable the incremental filtering feature, which allows end-users to filter out the dropdown list’s values.