I am using a checkbox webserver controls in template column of a datagrid webserver Control
I am trying to iterate through the datagid and process rows based on the whether the checkbox for the row is checked or not. However when I attempt to retrieve the selection the checkbox.checke d state is false for all rows regardless of whehter the checkbox was checked or not
Here is what I have any assistance appreciated
<Itemtemplate >
<asp:Checkbox id =”checkbox1” runat= “server” autopostback= “true”></asp:Checkbox>
</Item template>
Dim ChBox As CheckBox
intCount As integer
For intCount to Datagrid1.Items .count -1
ChBox = Datagrid1.Items (intCount).Cell s(0).Controls(1 )
If chBox.checked
‘Do some stuff
Else
‘Do something else
Next
I am trying to iterate through the datagid and process rows based on the whether the checkbox for the row is checked or not. However when I attempt to retrieve the selection the checkbox.checke d state is false for all rows regardless of whehter the checkbox was checked or not
Here is what I have any assistance appreciated
<Itemtemplate >
<asp:Checkbox id =”checkbox1” runat= “server” autopostback= “true”></asp:Checkbox>
</Item template>
Dim ChBox As CheckBox
intCount As integer
For intCount to Datagrid1.Items .count -1
ChBox = Datagrid1.Items (intCount).Cell s(0).Controls(1 )
If chBox.checked
‘Do some stuff
Else
‘Do something else
Next
Comment