checkboxes nested in a gridview



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....
.



Relevant Pages

  • Re: run sub routine with multiple conditions
    ... Private Sub CommandButton1_Click ... Dim bolCheck as Boolean ... how can I select any combination of checkboxes ...
    (microsoft.public.excel.programming)
  • Re: field properties in queries - "description" even though description ent
    ... and gave it a description in the query. ... All the fieldnames were essentially sentences in the table I was working on. ... Dim rs As Recordset ... So maybe the problem is with the checkboxes. ...
    (microsoft.public.access.modulesdaovba)
  • RE: DataGridView with databound combobox
    ... Protected Sub cboAcitvityTime_DataBound(ByVal sender As Object, ... Dim gvr As GridViewRow = CType ... "'cboActivityTime' has a SelectedValue which is invalid because it does not ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Two Questions
    ... I do want 0 to appear at the end of columns with checkboxes ... Dim pTable As Word.Table ... using Google Groups has appreared in MSNEWS that I can tell. ... I thought I would simple evaluate each cell in each column of a ...
    (microsoft.public.word.vba.general)
  • Re: Macro to email with "active row" info
    ... "Ron de Bruin" wrote: ... I add two checkboxes from the control toolbox on the sheet named ... Dim sh As Worksheet ... information from the active row. ...
    (microsoft.public.excel.misc)