Hi, I'm having a problem with a Grid, the thing is that I automatically expand the items and save the expand state when an update is done...but sometimes brings me this error:
Specified argument was out of the range of valid values.
Parameter name: ItemHierachicalIndex
I got the code to keep the state of the grid, from a telerik forum; this is where the page marks me the error
Specified argument was out of the range of valid values.
Parameter name: ItemHierachicalIndex
I got the code to keep the state of the grid, from a telerik forum; this is where the page marks me the error
Protected Sub RadGrid1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.DataBound
'Expand all items using our custom storage
Dim indexes As String() = New String(Me.ExpandedStates.Keys.Count) {}
Me.ExpandedStates.Keys.CopyTo(indexes, 0)
Dim arr As New ArrayList(indexes)
'Sort so we can guarantee that a parent item is expanded before any of
'its children
arr.Sort()
For Each key As String In arr
If key Is Nothing Then
Else
Dim value As Boolean = DirectCast(Me.ExpandedStates(key), Boolean)
If value Then
------------------------>>>>>> RadGrid1.Items(key).Expanded =
True <<<<<<<---------------------
End If
End If
Next
End Sub