Back to Devexpress

Filter Control

aspnet-116149-components-vertical-grid-concepts-data-shaping-and-manipulation-filtering-filter-control.md

latest6.5 KB
Original Source

Filter Control

  • Jun 16, 2022
  • 4 minutes to read

This topic contains the following sections.

The filter control allows end-users to build complex filter criteria with an unlimited number of filter conditions, combined by logical operators.

How to Invoke the Filter Control

The filter control can be invoked by clicking the filter image or filter expression displayed in the filter bar, whose visibility is controlled by the ASPxGridSettings.ShowFilterBar property.

The ASPxGridSettings.ShowFilterBar property can be set to the following values.

  • Hidden - The filter bar is always hidden.
  • Visible - The filter bar is always visible.
  • Auto - The filter bar is shown displayed when grid data is filtered (e.g., by the header filter).

You can show and hide the filter control in code using the following methods.

ActionClient-side methodsServer-side methods
ShowASPxClientVerticalGrid.ShowFilterControlASPxGridBase.ShowFilterControl
HideASPxClientVerticalGrid.CloseFilterControlASPxGridBase.HideFilterControl

How to Specify Visibility of Filter Control Elements

Row Visibility

By default, the filter control allows end-users to create filter criteria with rows that are visible in the grid. Set the ASPxGridFilterControlSettings.ShowAllDataSourceColumns property to true to display all rows from the data source in the filter control (even if these rows are not visible in the grid).

The filter control can display hierarchical rows provided that the ASPxGridFilterControlSettings.AllowHierarchicalColumns property is set to true. In this case, you can use the ASPxGridFilterControlSettings.MaxHierarchyDepth property to limit the max hierarchy depth level.

Tab Visibility

End-users can create filter criteria using visual representation ( Visual tab) or by typing the criteria as text ( Text tab). The content of the tabs is automatically synchronized. Note that the Text tab is disabled by default, and the Visual tab header is not displayed. Set the ASPxGridFilterControlSettings.ViewMode property to VisualAndText to enable them.

Group Operator Visibility

You can control the visibility of group operators displayed in the drop-down menu using the ASPxGridFilterControlSettings.GroupOperationsVisibility property.

Operand Type Button Visibility

The operand type button allows end-users to switch a filter condition between two modes:

  • Comparing a field’s value to a specified criteria value.

  • Comparing fields values to each other. For example, filtering records where the “Units in stock” field value is greater than the “Units on order” one.

The button visibility is controlled by the ASPxGridFilterControlSettings.ShowOperandTypeButton property.

Visibility of Filter Operators

The filter control drop-down window displays different comparison operators based on the row data type. The table below lists comparison operator visibility for different row types.

Filter Comparison OperatorString Row[1]ComboBox RowBinary Image RowDate RowOther Type Row(Numbers, etc.)
Equalsyesyes (default value)noyes (default value)yes
Does not equalyesyesnoyesyes
Is greater thanyesnonoyesyes (default value)
Is greater than or equal toyesnonoyesyes
Is less thanyesnonoyesyes
Is less than or equal toyesnonoyesyes
Is betweenyesnonoyesyes
Is not betweenyesnonoyesyes
Containsyesnononono
Does not containyesnononono
Begins withyes (default value)nononono
Ends withyesnononono
Is likeyesnononono
Is not likeyesnononono
Is blankyesyesnoyesyes
Is not blankyesyesyes (default value)yesyes
Is any ofyesyesyesyesyes
Is none ofyesyesnoyesyes
Date operators[2]nononoyesno

Footnotes

  1. A string row is a row containing string values or a row whose GridDataColumnSettings.FilterMode property is set to DisplayText.

  2. For date rows, the filter control displays an additional list of date operators.

See Also

Filter Control

Filter Builder (Filter Control)

Online Demo: Vertical Grid - Filter Control