Reputation: 12709
I have a telerik RadGrid with AutoGenerateColumns-AtRuntime=true.i need to clear the filters in the radgrid on a button click.i have the following code which is not working
foreach (GridColumn column in gridSearchL3.MasterTableView.OwnerGrid.Columns)
{
column.CurrentFilterFunction = GridKnownFunction.NoFilter;
column.CurrentFilterValue = string.Empty;
}
gridSearchL3.MasterTableView.FilterExpression = string.Empty;
please help.
Upvotes: 1
Views: 8002
Reputation: 11154
Please try with below link.
http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-clear-filters.aspx
Upvotes: 1
Reputation: 8598
Shouldn't it be:
foreach (GridColumn column in gridSearchL3.MasterTableView.Columns)
{
column.CurrentFilterFunction = GridKnownFunction.NoFilter;
column.CurrentFilterValue = String.Empty;
}
gridSearchL3.MasterTableView.FilterExpression = String.Empty;
I use this code on a button press to clear filters on my web order portal and it seems to work fine. I'd guess that your for each statement is slightly different.
Upvotes: 3