Thursday, January 3, 2013

How to Clear RadGrid Filters


If you have auto generated columns in the RadGrid use the below code.

foreach (GridColumn column in gridSearchL3.MasterTableView.AutoGeneratedColumns)
{
 column.CurrentFilterFunction = GridKnownFunction.NoFilter;
 column.CurrentFilterValue = string.Empty;
}
gridSearchL3.MasterTableView.FilterExpression = string.Empty;

If the columns are not auto generated use the below code.

foreach (GridColumn column in gridSearchL3.MasterTableView.OwnerGrid.Columns) 

  column.CurrentFilterFunction = GridKnownFunction.NoFilter; 
  column.CurrentFilterValue = string.Empty; 
gridSearchL3.MasterTableView.FilterExpression = string.Empty;

No comments:
Write comments
Recommended Posts × +