GridOptionsFilter.InHeaderSearchMode Property
Gets or sets whether users can search for column data within built-in column header search boxes.
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v21.1.dll
NuGet Packages: DevExpress.Win.Design, DevExpress.Win.Grid
Declaration
[DefaultValue(GridInHeaderSearchMode.Default)]
[XtraSerializableProperty]
public virtual GridInHeaderSearchMode InHeaderSearchMode { get; set; }
Property Value
Type | Default | Description |
---|---|---|
GridInHeaderSearchMode | **Default** | A value that specifies whether built-in column header search boxes are enabled. |
Available values:
Name | Description |
---|---|
Default | Equivalent to the Disabled option. |
Disabled | Built-in column header search boxes are disabled. |
TextFilter | Built-in column header search boxes are enabled. |
Property Paths
You can access this nested property as listed below:
Object Type | Path to InHeaderSearchMode |
---|---|
GridView |
|
Remarks
Set the InHeaderSearchMode property to TextFilter to enable built-in search boxes within the View’s column headers. Users can type text in the search boxes to filter against the columns.
Note
Built-in search boxes are only supported in skinning paint themes.
Use the GridColumn.OptionsFilter.AllowInHeaderSearch property to disable header search boxes for individual columns.
The following example enables search boxes for all grid columns except the colOrderID column.
gridView1.OptionsFilter.InHeaderSearchMode = GridInHeaderSearchMode.TextFilter;
colOrderID.OptionsFilter.AllowInHeaderSearch = DevExpress.Utils.DefaultBoolean.False;
If a column’s header search box is enabled, users can activate it as follows:
- Hover over the column header and click the search icon ().
Move focus to the column and press the CTRL+F shortcut. If an in-place editor is active, it intercepts the shortcut, and the search box is not invoked.
The CTRL+F shortcut opens the Find Panel if the search box is disabled for the focused column. Also note that if header search boxes are enabled, the Find Panel cannot be embedded in the Group Panel (see FindPanelLocation).
Search Syntax
The following list demonstrates sample search expressions supported in column header search boxes:
Spa
— finds records whose column values contain this string (in non-numeric columns).10
- finds records whose column values are equal to “10” (in numeric columns).=Spain
or=22
— finds records whose column values are equal to the specified value.<>40
— finds records whose column values are not equal to the specified value .Other supported comparison operators include:
<
,>
,<=
,>=
, and!=
(equivalent to<>
).=USA,Spain,Germany
or=USA;Spain;Germany
— finds records whose column values are equal to any of these listed values.[10:20]
or[10..20]
— finds records whose column values belong to the specified inclusive range.
Text search is case-insensitive.
Standard Filter Drop-down List
If a header search box is enabled for a column, the Data Grid hides the header’s filter button () used to invoke the standard filter drop-down list. In this case, users can open the filter drop-down list from the column header’s context menu.
Specify and Clear Search Text in Code
Use the GridColumn.SearchText property to specify text in a search box.
Set the GridColumn.SearchText property to an empty string, or call the GridView.ClearInHeaderSearchText method to clear the search text.