Skip to main content

DxGrid.SearchTextParseMode Property

Specifies how the grid treats search words.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.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 example below, the Grid component finds every Anna, Annabelle, and Hanna that are from Canada.

<DxGrid Data="@Data" 
        ShowSearchBox="true" 
        SearchTextParseMode="GridSearchTextParseMode.GroupWordsByAnd" 
        SearchText="anna canada">
    <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 example below, the Grid component finds every Anna, Annabelle, and Hanna, and every person from Canada.

<DxGrid Data="@Data" 
        ShowSearchBox="true" 
        SearchTextParseMode="GridSearchTextParseMode.GroupWordsByOr"
        SearchText="anna canada">
    <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 example below, the Grid component finds every Anna Canada and Hanna Canada.

<DxGrid Data="@Data" 
        ShowSearchBox="true" 
        SearchTextParseMode="GridSearchTextParseMode.ExactMatch"
        SearchText="anna canada">
    <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