chamara
chamara

Reputation: 12709

RadGrid Clear Filters

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

Answers (2)

KreepN
KreepN

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

Related Questions