blazor-devexpress-dot-blazor-dot-dxgrid-796fbee5.md
Specifies how the grid treats search words.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[DefaultValue(GridSearchTextParseMode.GroupWordsByAnd)]
[Parameter]
public GridSearchTextParseMode SearchTextParseMode { get; set; }
| 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.
|
| | 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.
|
| | ExactMatch |
The search words are not treated separately. Only records that match the search text exactly are shown.
|
|
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.
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>
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>
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 text can include special characters that allow users to create composite criteria. Refer to the following section for additional information: Search Syntax.
For additional information about search in the Grid component, refer to the following topic: Search Box in Blazor Grid.
See Also