Skip to main content

DxGrid.SearchTextChanged Event

Fires when the search text changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public EventCallback<string> SearchTextChanged { get; set; }

Parameters

Type Description
String

A new value of the SearchText property.

Remarks

The SearchTextChanged event fires each time the SearchText property value changes. The event is handled automatically when you use two-way data binding for the SearchText property (@bind-SearchText).

You can also handle this event to create a custom response to search text changes.

<DxGrid Data="@Data" 
        SearchText="@searchText"
        SearchTextChanged="OnSearchTextChanged"
        ShowSearchBox="true">
    <Columns>
        <DxGridDataColumn FieldName="ContactName"/>
        <DxGridDataColumn FieldName="City"/>
        <DxGridDataColumn FieldName="Country"/>
    </Columns>
</DxGrid>
<text>@SearchTextInfo</text>

@code {
    object Data { get; set; }
    string searchText { get; set; }
    string SearchTextInfo { get; set; }

    void OnSearchTextChanged(string newSearchText) {
        SearchTextInfo = "The current search text is: " + newSearchText;
    }

    // ...
}

Grid Search Info

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

See Also