<telerik:GridTemplateColumn UniqueName="CVATemplateColumn" InitializeTemplatesFirst="false"> <HeaderTemplate> <asp:Button ID="id" runat="server" OnClick="NewWindowCommand" /> </HeaderTemplate></telerik:GridTemplateColumn>protected void NewWindowCommand(object sender, EventArgs e){ RadWindowManager windowManager = new RadWindowManager(); RadWindow radWindow = new RadWindow(); // Set the window properties radWindowNavigateUrl = "radWindow.aspx"; radWindow.ID = "radWindowId"; radWindow.VisibleOnPageLoad = true; windowManager.Windows.Add(radWindow ); Form.Controls.Add(radWindow );}<telerik:RadGrid>....</telerik:RadGrid><asp:Button ID="id" runat="server" OnClick="NewWindowCommand" />(rgdGenderAgeSummaryReport.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem)["ExpandColumn"].Visible = false; foreach (GridDataItem dataItem in rgdGenderAgeSummaryReport.MasterTableView.Items) { dataItem["ExpandColumn"].Style["display"] = "none"; dataItem["ExpandColumn"].Visible = false; }<telerik:RadDockZone ID="RadDockZone1" runat="server" Height="300px" Width="300px"><telerik:RadDock ID="RadDock1" runat="server" Width="300px"><ContentTemplate> <scheduler:MultipleValuesResourceControl runat="server" ID="ResStudent" Type="Student" Label="User: " /></ContentTemplate></telerik:RadDock></telerik:RadDockZone>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();
--------------