Radzen OnFilter clear function trigger

When we use FilterMode="FilterMode.Simple" in radzen datagrid, we obtain filtered grid data in gridRef.view, however when we clear the filter, which functions are triggered? Because on clear, we need to transmit grid values to child components and on that data, we need to load specific functions for computation, which we can do on filter but not on clear. Is there any method we can fulfill this need on clear?

You can use this event:

1 Like

Thanks for your comment.
Based on the filtered grid data, I want to present a calculation on the top of the parent page itself. The Filter function provides the filtered data, but the Clear method regains my original data without affecting other column filters. Is there any way to do this?

The View property of the DataGrid represents currently displayed data.

Right gridRef.view returns the current data but on clear i want my original data back

Your original data is assigned to Data.

Ok thanks but if i want to trigger onClearFilter function ( callback function ) on clear grid column filter and when filter clears i want to reload gird with all existing data, n i have filter option for more than 5 columns.

@enchev requesting you to please check this, we need this for our deployment next week.
Is there a event which we can use when user clear the filter to write a code to refresh the other data element?

1 Like

Hey @sanketkulkarnilbmc,

Our forum is free for all however guaranteed support is provided only for paid subscribers. If you have subscription you can contact us at info@radzen.com otherwise do not demand support or we will have no other option but discontinue your account.

Update: I just saw that your company have valid subscription and I will update your forum account.

If you simply assign Data again the DataGrid will clear all the filters and will be reloaded.

As I already mentioned the event is called FilterCleared. You can check it in this demo: Blazor DataGrid Component - Advanced Filter Mode | Free UI Components by Radzen

Thanks a lot @enchev it is working fine for a advanced mode ; but our bussiness needs a simple mode in our datagrid; in that case i tried and onClearFilter is not getting called.

Is this supported for when mode is simple? is there a different way for this case.

Really appreciated your efforts on this

There is no different way for Simple mode. We will check the implementation and we will provide fix if necessary in our next update before the end of next week.

hi @enchev

This issue that I observed is if the trigger function is empty then the trigger is getting called but when we are calling some other function inside. the triggers are not getting called.

I've just verified that FIlterCleared event is raised in simple filtering as well: