A
abbas24
I have a gridview with datakeyname = "module_id" and there are checkboxes in the itemtemplate...
Now on the click of a button I want to check which checkboxes are checked and which are not checked....
below is my code....
Dim module_string As String
For Each gvrows As GridViewRow In gvw_modules.Rows
Dim cb As CheckBox = DirectCast(gvrows.FindControl("chk_module"), CheckBox)
If cb IsNot Nothing Then
If cb.Checked Then
module_string = module_string & "," & gvw_modules.DataKeys(gvrows.RowIndex).Value
End If
End If
Next
But it just gives value as 1, Rowindex is increasing properly but Value remains 1 only...I dont understand where am I going wrong....
Now on the click of a button I want to check which checkboxes are checked and which are not checked....
below is my code....
Dim module_string As String
For Each gvrows As GridViewRow In gvw_modules.Rows
Dim cb As CheckBox = DirectCast(gvrows.FindControl("chk_module"), CheckBox)
If cb IsNot Nothing Then
If cb.Checked Then
module_string = module_string & "," & gvw_modules.DataKeys(gvrows.RowIndex).Value
End If
End If
Next
But it just gives value as 1, Rowindex is increasing properly but Value remains 1 only...I dont understand where am I going wrong....