Completed
Last Updated: 28 Jul 2023 08:12 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.  
3 comments
ADMIN
Yanislav
Posted on: 28 Jul 2023 08:12

Hello Matthew,

I'm sharing my answer from our private discussion here, so the community can benefit from it too.

====

To reset the Grid filters, you can clear the FilterDescriptors collection within the Grid state.

   <GridToolBarTemplate>
        <GridSearchBox />
        <TelerikButton ThemeColor="primary" OnClick="@ClearGridFilter">Clear Filters</TelerikButton>
    </GridToolBarTemplate>

...

    private async Task ClearGridFilter()
    {
        GridState<SampleData> desiredState = new GridState<SampleData>()
        {
            //clears the filter list in the new Grid state
            FilterDescriptors = new List<IFilterDescriptor>()
        };

        await GridRef.SetStateAsync(desiredState);
    }

REPL example: https://blazorrepl.telerik.com/cnYhmePa18XcXOGI28

====

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.