This is a migrated thread and some comments may be shown as answers.

Collapse Group throws 'Specified argument was out of the range of valid values.'

1 Answer 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Phil H.
Top achievements
Rank 2
Phil H. asked on 25 Nov 2008, 01:50 PM
Hi

I am using the example code Collapse group and it throws an ArgumentOutOfRageExceptiopn (Specified argument was out of the range of valid values).  I believe it is the Controls(0).  My Grouping is static, defined in Asp code.  It works with out this code.  I have Telerik Asp.Net AJAX 2008 3 1105 dll's.

Partial Class Dispatcher_MismatchedReport
    Inherits System.Web.UI.Page
    '
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Not (IsPostBack)) Then
            CollapseAll()
        End If
    End Sub ' Page_Load
    '
    Private Sub CollapseAll()
        Dim item As GridItem
        For Each item In RadGrid1.MasterTableView.Controls(0).Controls
            If TypeOf item Is GridGroupHeaderItem Then
                item.Expanded = False
            End If
        Next item
    End Sub ' CollapseAll
    '
End Class

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Phil
Top achievements
Rank 2
answered on 26 Nov 2008, 01:37 AM
Well, a little egg on my face,... you can not collapse what does not exist...  Do it in the Pre_Render not Page_Init.
Tags
Grid
Asked by
Phil H.
Top achievements
Rank 2
Answers by
Phil
Top achievements
Rank 2
Share this question
or