Gridview with checkboxes
I've created a gridview bound it to a dataset and added two checkbox columns. What I would like to have happen is when a user checks the box, then clicks the submit button, the row with the box checked will be updated in the database. The problem I'm facing is when the user clicks on a checkbox and pushes the submit button the checkbox.checked method is always False.
Protected Sub btnSubmit_Clicked(ByVal sender As Object, ByVal e As EventArgs) Handles btnSubmit.Clicked
For Each row As GridViewRow in grdResults.Rows
Dim chkbox1 As CheckBox = CType(row.FindControl("ckb1"), CheckBox)
If chkbox1.Checked = True
check1 = True
EdIDs += CType(row.FindControl("edid1"), Label).Text.ToString() + ","
End If
Dim chkbox2 As CheckBox = CType(row.FindControl("ckb2"), CheckBox)
If chkbox2 .Checked = True
check2 = True
EdIDs += CType(row.FindControl("edid2"), Label).Text.ToString() + ","
End If
|