Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

    DxGrid.SearchTextChanged Event

    Fires when the search text changes.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    #Declaration

    C#
    [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.

    Razor
    <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