I have implemented Filtering in my RadGrid, however, the filtering is done at the database, not by the Grid Control. Therefore I handle the Grid ItemCommand event, check for the Filter Command, build a filter string based on the filterPair, cancel the filter command and rebind the grid with the filterstring. Everything works fine except I have noticed a couple issues:
1) After the grid is rebound, if I click on the filtermenu icon, the "NoFilter" item is selected, even though the grid was filtered with some other selection (such as "StartsWith"). I assume this is because I set e.cancelled = true in the ItemCommand event. Is there a way to set the proper selected filter menu item after the grid is rebound? In the ItemCommand Event, I store the various column filter selections in viewstate, so I believe, If I am able to access the filter menu somehow, I should be able to set the right value (hopefully without firing another filter event)
2) When simple filtering is used and the user selects the "NoFilter" option to remove the filter, the text value they specified is cleared. This doesn't occur in my scenarion, and again I assume it is because I set e.cancelled = true in the ItemCommand event.. I tried adding the following to the ItemCommand Event handler:
What happens is, the filter value disappears for a moment, but then returns when the grid is finsihed rebinding. Is there a way to clear this text if the "NoFilter" option is selected?
1) After the grid is rebound, if I click on the filtermenu icon, the "NoFilter" item is selected, even though the grid was filtered with some other selection (such as "StartsWith"). I assume this is because I set e.cancelled = true in the ItemCommand event. Is there a way to set the proper selected filter menu item after the grid is rebound? In the ItemCommand Event, I store the various column filter selections in viewstate, so I believe, If I am able to access the filter menu somehow, I should be able to set the right value (hopefully without firing another filter event)
2) When simple filtering is used and the user selects the "NoFilter" option to remove the filter, the text value they specified is cleared. This doesn't occur in my scenarion, and again I assume it is because I set e.cancelled = true in the ItemCommand event.. I tried adding the following to the ItemCommand Event handler:
Dim txtBox As TextBox = CType((CType(e.Item, GridFilteringItem))(filterPair.Second).Controls(0), TextBox)
If filterPair.First.ToString = "NoFilter" Then
txtBox.Text = String.Empty
End If
What happens is, the filter value disappears for a moment, but then returns when the grid is finsihed rebinding. Is there a way to clear this text if the "NoFilter" option is selected?