7 Answers, 1 is accepted

Try the following code snippets for clearing the filtering.
VB:
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) |
RadGrid1.MasterTableView.FilterExpression = Nothing |
RadGrid1.MasterTableView.Rebind() |
End Sub |
Thanks,
Shinu.

Private
Sub clearRgHFilters()
For Each item As GridItem In rgH.Items
If TypeOf item Is GridFilteringItem Then
Dim filteringItem As GridFilteringItem = CType(item, GridFilteringItem)
Dim merchbox As TextBox = CType(filteringItem("MERCHANT_NAME").Controls(0), TextBox)
merchbox.Text =
""
Dim transcomp As TextBox = CType(filteringItem("TRANS_COMP").Controls(0), TextBox)
transcomp.Text =
""
Dim cardholder As TextBox = CType(filteringItem("SORTNAME").Controls(0), TextBox)
cardholder.Text =
""
Dim job As TextBox = CType(filteringItem("JOBNUM").Controls(0), TextBox)
job.Text =
""
Dim phase As TextBox = CType(filteringItem("PHASE").Controls(0), TextBox)
phase.Text =
""
Dim cat As TextBox = CType(filteringItem("CATEGORY").Controls(0), TextBox)
cat.Text =
""
Dim postdate As TextBox = CType(filteringItem("CMIC_POST_DATE").Controls(0), TextBox)
postdate.Text =
""
Dim transnum As TextBox = CType(filteringItem("SOURCE_TXN_NUMBER").Controls(0), TextBox)
transnum.Text =
""
Exit For
End If
Next
See the code executed from the OnClick handler of the Clear Filters button on this online demo:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandcombo/defaultcs.aspx?product=grid
Best regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.


Protected
Sub clrFilters_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
For Each column As GridColumn In radGrid1.MasterTableView.Columns
column.CurrentFilterFunction = GridKnownFunction.NoFilter
column.CurrentFilterValue =
String.Empty
Next
radGrid1.MasterTableView.FilterExpression =
String.Empty
radGrid1.MasterTableView.FilterExpression =
Nothing
radGrid1.MasterTableView.Rebind()
End Sub
and when the grid rebinds, i get an empty first row
The size of the dataset did not change, but the grid is adding a blank row at the top. If I filter again, it is gone.
If I clear the filters by clearing the filter text in each column, I do not get the blank row, it only happens when clicking the "Clear Filters" button.
Any ideas?
Hello Richard,
This is indeed an odd issue and unfortunately from the provided information I am not able to determine the exact cause of it. Can you provide a live url or a sample project (attached to a regular support ticket) which exhibits the abnormality? Thus I will do my best to advice you further.
Also verify that you are using the latest release 2009.2.701 of RadControls for ASP.NET AJAX in your project.
Kind regards,
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
