All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

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

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
.OptionsFilter.InHeaderSearchMode

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.

Data Grid - In-header search box

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 (Data Grid - 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 (GridView- Column 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.

Data Grid - Show Column Filter menu item

Specify and Clear Search Text in Code

Use the GridColumn.SearchText property to specify text in a search box.

colQuantitycolQuantity.SearchText = ">=20";

Set the GridColumn.SearchText property to an empty string, or call the GridView.ClearInHeaderSearchText method to clear the search text.

See Also