B
Bnob
I read some articles about the way to find the rows having his checkbox
checked.
Here is the code
Private Sub btnModifier_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnModifier.Click
Dim dgItem As DataGridItem
Dim chkSelected As CheckBox
For Each dgItem In Me.DataGrid1.Items
chkSelected = dgItem.FindControl("chkSelect")
If chkSelected.Checked Then
'--- my code
End If
Next
end sub
In my asp page I have this for my datagrid:
<Columns>
<asp:TemplateColumn>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:CheckBox id="chkSelect" Runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
My problem is when I click on my btnModifier button, my code never
execute. The if statment always return false.
Any idea?
checked.
Here is the code
Private Sub btnModifier_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnModifier.Click
Dim dgItem As DataGridItem
Dim chkSelected As CheckBox
For Each dgItem In Me.DataGrid1.Items
chkSelected = dgItem.FindControl("chkSelect")
If chkSelected.Checked Then
'--- my code
End If
Next
end sub
In my asp page I have this for my datagrid:
<Columns>
<asp:TemplateColumn>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:CheckBox id="chkSelect" Runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
My problem is when I click on my btnModifier button, my code never
execute. The if statment always return false.
Any idea?