Completed
Last Updated: 09 Apr 2025 07:06 by ADMIN
n/a
Created on: 31 Aug 2022 21:46
Category: Grid
Type: Feature Request
6
Clear All Grid Filters parameter

Would like a parameter in the grid definition that would display a Clear/Refresh button to return the grid to all originally selected records.  This feature would work similar to the Excel clear filter function.  

===

TELERIK EDIT: To reset the Grid filters, you can clear the FilterDescriptors collection and the SearchFilter property in the Grid state. Here is an example:

https://blazorrepl.telerik.com/cfEoatOr000uBdgW48

    private TelerikGrid<Product>? GridRef { get; set; }

    private async Task ClearGridFilters()
    {
        var gridState = GridRef!.GetState();

        gridState.FilterDescriptors = new List<IFilterDescriptor>();
        gridState.SearchFilter = default;

        await GridRef.SetStateAsync(gridState);
    }
5 comments
ADMIN
Dimo
Posted on: 09 Apr 2025 07:06

Hello Jordan,

Thanks for stepping in! Your approach is indeed better and consistent with our Grid state documentation. I assume our previous suggestion was a mere oversight. I edited the old posts in the thread to avoid any confusion.

Regards,
Dimo
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Jordan
Posted on: 08 Apr 2025 21:02

For other folks finding this useful discussion via searches, the solution from 2023 is too heavy-handed, because it resets everything about the grid state; not just the filters. So, for example, if the user has some sorting applied, they would lose that when clearing all filters. Currently, this can be handled in a more targeted manner by getting the current grid state, clearing just its filter descriptors, then setting the modified state back on the grid (forgive the formatting if this is ugly - I don't see a way to make a nice code block with the controls on this editor):

var gridState = GridRef.GetState();

gridState.FilterDescriptors = [];

await GridRef.SetStateAsync(gridState);

ADMIN
Yanislav
Posted on: 28 Jul 2023 08:12

Hello Matthew,

To reset the Grid filters, you can clear the FilterDescriptors collection and the SearchFilter property in the Grid state. Here is an example:

https://blazorrepl.telerik.com/cfEoatOr000uBdgW48

    private TelerikGrid<Product>? GridRef { get; set; }

    private async Task ClearGridFilters()
    {
        var gridState = GridRef!.GetState();

        gridState.FilterDescriptors = new List<IFilterDescriptor>();
        gridState.SearchFilter = default;

        await GridRef.SetStateAsync(gridState);
    }

Regards,
Yanislav
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!
Matthew
Posted on: 21 Jul 2023 20:35
Did you find a way to accomplish this?

I'm trying to perform the same operation.
ADMIN
Stamo Gochev
Posted on: 06 Sep 2022 05:37

Hi Jeff,

We have considered similar options in the past but decided that such functionality is more appropriate to a Spreadsheet component, which is why clearing filters can happen on specific columns only. However, you can implement such a functionality using a custom button (e.g. in the toolbar of the Grid) that clears all filters (or modifies them in a way that suits your needs).

Regards,
Stamo Gochev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.