This is a migrated thread and some comments may be shown as answers.

Can't clear filters clientside

1 Answer 134 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jamel
Top achievements
Rank 1
Jamel asked on 01 Dec 2015, 11:19 AM

Hello everyone,

 

I have a small issue with clearin filter with my grid, the skin that I use is silk and has the EnableHeaderContextFilterMenu on "true". But when I want to use a different filter the other filters won't be cleared also when I call: grid.get_masterTableView().get_filterExpressions().clear(); . So how is it possible to clear all my filters after I fire a new on my grid>

 

For filtering I use clientside script this is my script for filtering the grid,

 

Thank you for your help. :)

function AddFilterExpressionbetween(columnUniqueName, dataField, filterValueFirst, filterValueSecond) {
 
    var grid = $find("<%=RadGrid1.ClientID%>");
 
     
    grid.get_masterTableView().get_filterExpressions().clear();
    grid.get_masterTableView().rebind();
    grid.get_masterTableView().filter(columnUniqueName, startDate + " " + endDate, Telerik.Web.UI.GridFilterFunction.Between, true);
     
    
}

 

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 03 Dec 2015, 09:53 AM
Hi Jamel,

If you are using server-side binding and want to clear the grid filtering from client-side action, you can achieve that by initiating a postback or AJAX request to the server:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/client-side-programming/gridtableview-object/methods/firecommand

And clear the filters during ItemCommand event handler:
http://www.telerik.com/forums/radgrid-clear-filters#NFrxMBwTvUmNIFPvIWVnIw

Hope this helps.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Jamel
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or