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

Attempt Reading the Checked Boxes on Page Load Postback Fails

2 Answers 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Deepak Vasudevan
Top achievements
Rank 2
Deepak Vasudevan asked on 14 Nov 2011, 10:17 PM
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 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 15 Nov 2011, 06:20 AM
Hello,

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

or

RadGrid1.MasterTableView.Items

Thanks,
Jayesh Goyani
0
Deepak Vasudevan
Top achievements
Rank 2
answered on 15 Nov 2011, 03:30 PM
The life cycle seems to be the culprit. Moving to Pre-render makes it visible. 
Tags
Grid
Asked by
Deepak Vasudevan
Top achievements
Rank 2
Answers by
Jayesh Goyani
Top achievements
Rank 2
Deepak Vasudevan
Top achievements
Rank 2
Share this question
or