Attempt Reading the Checked Boxes on Page Load Postback Fails

3 posts, 0 answers
  1. Deepak Vasudevan
    Deepak Vasudevan avatar
    82 posts
    Member since:
    May 2010

    Posted 14 Nov 2011 Link to this post

    Dear Telerik Team,

    I have the following snippet of code which is located in the postback section of Page_Load. Two checkboxes were checked but it still shows 'false'. 

    'Attempt reading the SelectedItems Before the Grid Repaints
                If (Me.IsPostBack) Then
                    SPID= String.Empty
                    For Each gi As GridDataItem In rgp.Items
                        Dim objValueCheckbox As Object = gi.FindControl("boolValue")
                        If (Not objValueCheckbox Is Nothing) Then
                            If (objValueCheckbox.GetType().Name = "CheckBox") Then
                                Dim chkValueCheckbox As CheckBox = DirectCast(objValueCheckbox, CheckBox)
                                If Not chkValueCheckbox.Attributes("PID") Is Nothing Then
                                    If (chkValueCheckbox.Checked) Then
                                        SPID= SPID& chkValueCheckbox.Attributes("PID") & ","
                                    End If
                                End If
                            End If
                        End If
                    Next


                    SPID= SPID.TrimEnd(",")
                End If
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 15 Nov 2011 Link to this post

    Hello,

    There is not any issue in your code.
    Please provide some more information.

    or

    RadGrid1.MasterTableView.Items

    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Deepak Vasudevan
    Deepak Vasudevan avatar
    82 posts
    Member since:
    May 2010

    Posted 15 Nov 2011 Link to this post

    The life cycle seems to be the culprit. Moving to Pre-render makes it visible. 
Back to Top