Skip to main content

DxGridDataColumn.FilterRowValueChanged Event

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[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