Skip to main content

DxGrid.ClearFilter() Method

Clears the filter applied to grid data.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.2.dll

NuGet Package: DevExpress.Blazor


public void ClearFilter()


The Grid applies a filter if any of the following includes filter conditions:

Call the ClearFilter method to clear all filter conditions.

The highlighted code block adds a button that clears filter conditions.

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

<DxGrid Data="@Data"
        @ref="MyGrid" >
        <DxGridDataColumn FieldName="OrderId" Caption="Order ID" DisplayFormat="d" />
        <DxGridDataColumn FieldName="OrderDate" DisplayFormat="d" />
        <DxGridDataColumn FieldName="ProductName" />
        <DxGridDataColumn FieldName="UnitPrice" DisplayFormat="c2" />
        <DxGridDataColumn FieldName="Shipped" UnboundType="GridUnboundColumnType.Boolean"
                          UnboundExpression="[ShippedDate] <> Null">
                <DxCheckBox CssClass="d-inline-block" Enabled="false" Checked="(bool)context.Value" />

<DxButton Click="@(() => MyGrid.ClearFilter())">Clear Filter</DxButton>

@code {
    object Data { get; set; }
    NorthwindContext Northwind { get; set; }
    IGrid MyGrid { get; set; }

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

    public void Dispose() {

Grid - Clear Filter in Code

To clear a filter condition for an individual column in code, call the FilterBy method and pass null to its value parameter.

<DxButton Click="@(() => MyGrid.FilterBy("ProductName", GridFilterRowOperatorType.Contains, null))">Clear the "Product Name" Filter Condition</DxButton>

Users can clear a filter condition in the filter row.


See Also