This handles a hyperlink button in the RadGrid, and it works fine. But if you try to apply a filter to the grid, you get the error:
Unable to cast object of type 'Telerik.Web.UI.GridFilteringItem' to type 'Telerik.Web.UI.GridDataItem'.
How do I get around this?
1 Answer, 1 is accepted
answered on 25 Nov 2013, 11:41 AM
You have to check whether the item is GridDataItem and only in this case to cast it. In order to get the filter item you could use GetItems method. Please check out the following code snippet.
Dim filter As GridFilteringItem = TryCast(RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)(0), GridFilteringItem)
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.