Back to Devexpress

Filter Control

aspnet-5138-components-grid-view-concepts-filter-data-filter-control.md

latest6.1 KB
Original Source

Filter Control

  • Sep 01, 2023
  • 3 minutes to read

This topic contains the following sections:

The filter control allows end users to build complex filter criteria with multiple filter conditions combined with logical operators.

How to Invoke the Filter Control

Click the filter image or filter expression displayed in the filter bar. The ASPxGridSettings.ShowFilterBar property defines the visibility of this bar.

You can set the ASPxGridSettings.ShowFilterBar property to the following values:

  • Hidden - The filter bar is always hidden.
  • Visible - The filter bar is always visible.
  • Auto - The filter bar is visible when grid data is filtered (for example, by the filter row or header filter).

Use the following methods to show and hide the filter control in code:

ActionClient-side methodsServer-side methods
ShowASPxClientGridView.ShowFilterControlASPxGridBase.ShowFilterControl
HideASPxClientGridView.CloseFilterControlASPxGridBase.HideFilterControl

How to Specify Visibility of Filter Control Elements

Column Visibility

The filter control allows end users to create a filter criteria for visible grid columns only (the default setting). Set the ASPxGridFilterControlSettings.ShowAllDataSourceColumns property to true to display all data source columns in the filter control.

The filter control can display hierarchical columns if the ASPxGridFilterControlSettings.AllowHierarchicalColumns property is set to true. In this case, you can use the ASPxGridFilterControlSettings.MaxHierarchyDepth property to limit the maximum hierarchy depth level.

Tab Visibility

End users can use the UI (the Visual tab) to create the filter criteria or enter this criteria as text (the Text tab). The content of the tabs is automatically synchronized. Set the ASPxGridFilterControlSettings.ViewMode property to VisualAndText to enable the Text tab.

Group Operator Visibility

Use the ASPxGridFilterControlSettings.GroupOperationsVisibility property to specify the visibility of group operators displayed in the drop-down menu.

Operand Type Button Visibility

The operand type button allows end users to switch a filter condition between two modes: one mode compares a field’s value to a value, and the other mode compares a field’s value to another field’s value. Set the ASPxGridFilterControlSettings.ShowOperandTypeButton property to true to display the operand type button.

Visibility of Filter Operators

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

Filter Comparison OperatorString Column[1]ComboBox ColumnBinary Image ColumnDate ColumnOther Type Column (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 column is a column containing string values or a column whose GridDataColumnSettings.FilterMode property is set to DisplayText.

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

See Also

Filter Control

Filter Builder (Filter Control)

Online Demo: Grid View - Filter Builder