Back to Devexpress

DxTreeList.SearchTextParseMode Property

blazor-devexpress-dot-blazor-dot-dxtreelist-4af7db7f.md

latest4.8 KB
Original Source

DxTreeList.SearchTextParseMode Property

Specify how the TreeList searches for a match if the query contains multiple words.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Property Value

TypeDefaultDescription
TreeListSearchTextParseModeGroupWordsByAnd

An enumeration value.

|

Available values:

NameDescriptionImage
GroupWordsByAnd

The TreeList searches for a row containing all the words from the search query (in any order).

|

| | GroupWordsByOr |

The TreeList searches for a row containing any word from the search query.

|

| | ExactMatch |

The TreeList searches for an exact matching phrase.

|

|

Remarks

The search feature filters data rows in the TreeList component and highlights search results. If the search text contains multiple words separated by a space, words can be treated as a single condition or individual conditions.

Use the SearchTextParseMode property to specify how the TreeList component searches for a match if the query contains multiple words.

Read Tutorial: Search Box Run Demo: TreeList - Search Box

GroupWordsByAnd

The TreeList searches for a row containing all words from the search query (in any order). Words are treated as individual conditions grouped with the AND logical operator.

In the following code snippet, the TreeList component finds every row that contains both Product and me in its cells:

razor
<DxTreeList Data="@Data"
            KeyFieldName="Id"
            ParentKeyFieldName="ParentId"
            ShowSearchBox="true" 
            SearchTextParseMode="TreeListSearchTextParseMode.GroupWordsByAnd"
            SearchText="Product me">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" Caption="Assigned To" />
    </Columns>
</DxTreeList>

GroupWordsByOr

The TreeList searches for a row containing any word from the search query. Words are treated as individual conditions grouped with the OR logical operator.

In the following code snippet, the TreeList component finds every row that contains Product or me in its cells:

razor
<DxTreeList Data="@Data"
            KeyFieldName="Id"
            ParentKeyFieldName="ParentId"
            ShowSearchBox="true" 
            SearchTextParseMode="TreeListSearchTextParseMode.GroupWordsByOr"
            SearchText="Product me">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" Caption="Assigned To" />
    </Columns>
</DxTreeList>

ExactMatch

The TreeList searches for an exact matching phrase.

In the following code snippet, the TreeList component finds every row that contains the Product me phrase in a cell:

razor
<DxTreeList Data="@Data"
            KeyFieldName="Id"
            ParentKeyFieldName="ParentId"
            ShowSearchBox="true" 
            SearchTextParseMode="TreeListSearchTextParseMode.ExactMatch"
            SearchText="Product me">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" Caption="Assigned To" />
    </Columns>
</DxTreeList>

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.

Implements

SearchTextParseMode

See Also

DxTreeList Class

DxTreeList Members

DevExpress.Blazor Namespace