We're displaying search results in a grid, and allowing filtering by column.
The issue I'm resolving is if a user filters, then hits the search button again, the results of the query are set as the data source, then the grid re-applies the filters on Rebind().
I want to clear the filters and show the data which the new search got from the database.
I found a thread which gave me something that works. Rather than do all this work for every grid in our application, I was looking for something like grid.ClearFilters().
Am I just missing the easier way? If not, that might be a nice convenience method.
Code-behind of my search button click:
------------
...set new search data...
grdUserSearchResults.MasterTableView.FilterExpression = String.Empty;
foreach (Telerik.Web.UI.GridColumn column in grdUserSearchResults.Columns)
{
column.CurrentFilterFunction = Telerik.Web.UI.GridKnownFunction.NoFilter;
column.CurrentFilterValue = String.Empty;
}
grdUserSearchResults.Rebind();
--------------