windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-gridoptionsfilter-4c954745.md
Gets or sets whether built-in column header search boxes are enabled. They allow users to search for column data or filter against columns.
Namespace : DevExpress.XtraGrid.Views.Grid
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
[DefaultValue(GridInHeaderSearchMode.Default)]
[XtraSerializableProperty]
public virtual GridInHeaderSearchMode InHeaderSearchMode { get; set; }
<DefaultValue(GridInHeaderSearchMode.Default)>
<XtraSerializableProperty>
Public Overridable Property InHeaderSearchMode As GridInHeaderSearchMode
| 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, and are used to filter against columns.
| | TextSearch |
Built-in column header search boxes are enabled, and are used to search in columns.
|
You can access this nested property as listed below:
| Object Type | Path to InHeaderSearchMode |
|---|---|
| GridView |
.OptionsFilter .InHeaderSearchMode
|
Set the InHeaderSearchMode property to TextFilter or TextSearch to enable built-in search boxes within the View’s column headers.
The GridColumn.OptionsFilter.AllowInHeaderSearch property allows you to disable header search boxes for individual columns.
Note
If the InHeaderSearchMode property is set to TextFilter , users can type text in the search boxes to filter against the columns.
If the InHeaderSearchMode property is set to TextSearch , users can type text in the search boxes to search for column data. The grid highlights cell text that matches the specified search string.
Use the following shortcuts to navigate between search results:
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;
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:
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.
=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.
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.
Use the GridColumn.SearchText property to specify text in a search box.
colQuantitycolQuantity.SearchText = ">=20";
colQuantity.SearchText = ">=20"
Set the GridColumn.SearchText property to an empty string, or call the GridView.ClearInHeaderSearchText method to clear the search text.
See Also