Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 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

DxGridDataColumn.FilterRowValueChanged Event

Fires when the value in the column’s filter row editor changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public EventCallback<object> FilterRowValueChanged { get; set; }

#Parameters

Type Description
Object

A new filter row value.

#Remarks

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

You can also handle this event to create a custom response to filter row value changes.

@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
@implements IDisposable

<DxGrid Data="@Data"
        ShowFilterRow="true">
    <Columns>
        <DxGridDataColumn FieldName="OrderId" Caption="Order ID" DisplayFormat="d" />
        <DxGridDataColumn FieldName="OrderDate" DisplayFormat="d" />
        <DxGridDataColumn FieldName="ProductName"
                          FilterRowValue="@FilterRowValue"
                          FilterRowValueChanged="OnFilterRowValueChanged"
                          FilterRowOperatorType="GridFilterRowOperatorType.Contains" />
        <DxGridDataColumn FieldName="UnitPrice" DisplayFormat="c2" />
        <DxGridDataColumn FieldName="Shipped" UnboundType="GridUnboundColumnType.Boolean"
                          UnboundExpression="[ShippedDate] <> Null"
                          FilterRowEditorVisible="false" />
    </Columns>
</DxGrid>

<div><b>@FilterRowValueInfo</b></div>

@code {
    object Data { get; set; }
    NorthwindContext Northwind { get; set; }
    string FilterRowValue { get; set; } = "Queso";
    string FilterRowValueInfo { get; set; }

    protected override void OnInitialized() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        Data = Northwind.Invoices.ToList();
    }

    void OnFilterRowValueChanged(object newFilterRowValue) {
        if (newFilterRowValue != null) {
            FilterRowValue = newFilterRowValue.ToString();
            FilterRowValueInfo = "The 'Product Name' column filter value is '" + FilterRowValue + "'";
        } else {
            FilterRowValue = "";
            FilterRowValueInfo = "The 'Product Name' column filter value is cleared";
        }
    }

    public void Dispose() {
        Northwind?.Dispose();
    }
}

Blazor Grid Filter Row Value Changed

For more information about filter row, see the following topic: Filter Row in Blazor Grid.

See Also