I'm having some trouble with a checkbox in a datagrid. I'm using VB.net for the behind code. When the code is run after a button click, the checked property is not being set to true although the box is checked. Here's the code to access the checkbox:
Dim cb As CheckBox
Dim dgi As DataGridItem
Dim i_Counter As Int16
For Each dgi In dg_Orders.Items
cb = CType(dgi.Cells(0).Controls(1), checkbox)
If cb.Checked = True Then
'Do something
End If
i_Counter += 1
Next
I can set the checkbox equal to checked with cb.checked = true, but for some reason when the box is clicked, the checked is not coming back true. Any ideas are greatly appreciated as I'm running out of them.
Thanks
Dim cb As CheckBox
Dim dgi As DataGridItem
Dim i_Counter As Int16
For Each dgi In dg_Orders.Items
cb = CType(dgi.Cells(0).Controls(1), checkbox)
If cb.Checked = True Then
'Do something
End If
i_Counter += 1
Next
I can set the checkbox equal to checked with cb.checked = true, but for some reason when the box is clicked, the checked is not coming back true. Any ideas are greatly appreciated as I'm running out of them.
Thanks