Skip to main content

DxGrid.SearchTextParseMode Property

Specifies how the grid treats search words.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(GridSearchTextParseMode.GroupWordsByAnd)]
[Parameter]
public GridSearchTextParseMode SearchTextParseMode { get; set; }

Property Value

Type Default Description
GridSearchTextParseMode GroupWordsByAnd

The text parse mode.

Available values:

Name Description Image
GroupWordsByAnd

The search words are treated as individual conditions grouped by the AND logical operator. Only records that match all of the conditions are shown.

Search Box: And Mode

GroupWordsByOr

The search words are treated as individual conditions grouped by the OR logical operator. Records that match at least one of these conditions are shown.

Search Box: Or Mode

ExactMatch

The search words are not treated separately. Only records that match the search text exactly are shown.

Search Box: Exact Mode

Remarks

The search feature allows users to locate and highlight the search text in grid data. If the search text contains multiple words separated by space characters, the words can be treated as a single condition or as individual conditions grouped by the Or or And operator.

Set the SearchTextParseMode property to one of the following values to specify how the Grid component treats search words.

Run Demo: Grid - Search Box

GroupWordsByAnd

The search words are treated as individual conditions grouped by the AND logical operator. Only the records that match all of the conditions are shown.

In the following code snippet, the Grid component finds every row that contains both Maria and Anders in its cells:

<DxGrid Data="@Data" 
        ShowSearchBox="true" 
        SearchTextParseMode="GridSearchTextParseMode.GroupWordsByAnd" 
        SearchText="maria anders">
    <Columns>
        <DxGridDataColumn FieldName="ContactName"/>
        <DxGridDataColumn FieldName="City"/>
        <DxGridDataColumn FieldName="Country"/>
    </Columns>
</DxGrid>

Search Box: And Mode

GroupWordsByOr

The search words are treated as individual conditions grouped by the OR logical operator. Records that match at least one of these conditions are shown.

In the following code snippet, the Grid component finds every row that contains Maria or Anders in its cells:

<DxGrid Data="@Data" 
        ShowSearchBox="true" 
        SearchTextParseMode="GridSearchTextParseMode.GroupWordsByOr"
        SearchText="maria anders">
    <Columns>
        <DxGridDataColumn FieldName="ContactName"/>
        <DxGridDataColumn FieldName="City"/>
        <DxGridDataColumn FieldName="Country"/>
    </Columns>
</DxGrid>

Search Box: Or Mode

ExactMatch

The search words are not treated separately. Only records that match the search text exactly are shown.

In the following code snippet, the Grid component finds every row that contains the Maria Anders phrase in a cell:

<DxGrid Data="@Data" 
        ShowSearchBox="true" 
        SearchTextParseMode="GridSearchTextParseMode.ExactMatch"
        SearchText="maria anders">
    <Columns>
        <DxGridDataColumn FieldName="ContactName"/>
        <DxGridDataColumn FieldName="City"/>
        <DxGridDataColumn FieldName="Country"/>
    </Columns>
</DxGrid>

Search Box: Exact Mode

Search Syntax

Search text can include special characters that allow users to create composite criteria. Refer to the following section for additional information: Search Syntax.

For more information about search in the Grid component, refer to the following topic: Search Box in Blazor Grid.

Implements

See Also