New to Telerik UI for Blazor? Start a free 30-day trial

Change the Grid Filter Mode at Runtime

Updated on Oct 19, 2026

Environment

ProductGrid for Blazor
Version15.0.1 and above

Description

How to change the Grid FilterMode at runtime?

This KB also answers the following question:

  • How to disable filtering and show the filter row or filter menu again?

Solution

Set the Grid FilterMode parameter to one of the following values:

  1. Set FilterMode to GridFilterMode.None to hide the filtering UI.
  2. Set FilterMode to GridFilterMode.FilterRow to display a filter row below the column headers.
  3. Set FilterMode to GridFilterMode.FilterMenu to display a filter button in the column headers.

When you change the filter mode at runtime, recreate the Grid so that it rebuilds the columns and filter templates. Use a render flag around the Grid, update the filter mode, and render the Grid again.

The following example demonstrates how to recreate the Grid after changing the filter mode:

Change the Grid FilterMode at runtime

Example
View Source
@if (ShowGrid)
{
    <TelerikGrid Data="@GridData"
                 FilterMode="@CurrentFilterMode">
        <GridColumns>
            <GridColumn Field="@nameof(Product.Name)" />
        </GridColumns>
    </TelerikGrid>
}

<TelerikButton OnClick="@(() => ChangeFilterMode(GridFilterMode.None))">
    Disable Filtering
</TelerikButton>
<TelerikButton OnClick="@(() => ChangeFilterMode(GridFilterMode.FilterRow))">
    Show Filter Row
</TelerikButton>
<TelerikButton OnClick="@(() => ChangeFilterMode(GridFilterMode.FilterMenu))">
    Show Filter Menu
</TelerikButton>

@code {
    private bool ShowGrid { get; set; } = true;
    private GridFilterMode CurrentFilterMode { get; set; } = GridFilterMode.FilterMenu;

    private async Task ChangeFilterMode(GridFilterMode newFilterMode)
    {
        ShowGrid = false;
        await Task.Delay(100);

        CurrentFilterMode = newFilterMode;
        ShowGrid = true;
    }

    private List<Product> GridData { get; set; } = new();

    private class Product
    {
        public string Name { get; set; } = string.Empty;
    }
}

This approach recreates the Grid after each filter mode change. If you also use Grid state, save the state before recreation and restore the applicable state after the Grid renders again. For more information, refer to the Grid state documentation.

See Also