checkboxes nested in a gridview

Discussion in 'ASP .Net' started by abbas24, Jul 9, 2012.

  1. abbas24

    abbas24 Guest

    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....
     
    abbas24, Jul 9, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWFjaGk=?=

    nested Repeaters with javascript checkboxes

    =?Utf-8?B?TWFjaGk=?=, Apr 16, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    535
    =?Utf-8?B?TWFjaGk=?=
    Apr 16, 2004
  2. Replies:
    0
    Views:
    5,571
  3. H5N1
    Replies:
    0
    Views:
    2,724
  4. jmhmaine
    Replies:
    4
    Views:
    421
    Steven Cheng[MSFT]
    Jan 24, 2005
  5. HeavyMetal

    GridView RowCommand problem: GridView Nested in Repeater

    HeavyMetal, Aug 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    815
    HeavyMetal
    Aug 8, 2006
Loading...

Share This Page