DataGrid Clear All Filters Button

Hello, I am trying to implement a button that clears all the filters on my data grid. I put the button on an empty cell in my table. I need this button to clear all the filters in my table and reset it to its original pre-filtered state. Some of my filters are text and others are dropdowns. The issue I am running into is that some of my filters are RadzenDropDown components like so:


I cannot seem to be able to get these dropdowns in the filters to reset properly, I've tried a few different things. Currently, I have added a ref to each of the 3 RadzenDropDown components in the filters that I need to clear and attempt to clear them once the clear filter button is hit:
image

Unfortunately, this ends up hitting the LoadData event 3 times causing bad behavior. Is there some way of just resetting them all at once so that my data grid can refresh once?

Hello, try this:

protected async Task ClearGridFilters()
{
	if (refDataGrid != null)
	{
		refDataGrid.Reset(false, false);

		refDataGrid.ColumnsCollection.ToList().ForEach(delegate (RadzenDataGridColumn<DataType> c)
		{
			c.ClearFilters();
		});

		await refDataGrid.Reload();
	}
}

@GodzSky I tried this and I get an issue I've been having where the text fields clear fine but the dropdowns do not. I can see the data clears because it changes for a second but the selected value in the dropdown stays, so it reverts back to it. See below:
Recording2024-06-28085341-ezgif.com-video-to-gif-converter
Any ideas? Thanks!

I guess its because you need to clear the variable binded to the dropdown of the filter template.
Try:

protected async Task ClearGridFilters()
{
	if (refDataGrid != null)
	{
		refDataGrid.Reset(false, false);
                
		varBindededToTemplate.Clear(); or varBindededToTemplate = null; Or varBindededToTemplate =  Enumerable.Empty<Type>();

		refDataGrid.ColumnsCollection.ToList().ForEach(delegate (RadzenDataGridColumn<DataType> c)
		{
			c.ClearFilters();
		});

		await refDataGrid.Reload();
		StateHasChanged(); //Try with and without
	}
}

I dont have any other idea why is not clearing those filters without doing any debug

This is the result of that code:
ezgif.com-video-to-gif-converter
As you can see, it does clear them now but it triggers multiple LoadData events that lead to unnecessary queries. I'm looking for the clear filter button to trigger a single refresh. Any clues?