PC Review


Reply
Thread Tools Rate Thread

checkboxes nested in a gridview

 
 
abbas24
Guest
Posts: n/a
 
      9th Jul 2012
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....
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= Microsoft ASP .NET 1 9th May 2006 07:48 PM
GridView nested in DataList - refreshing corresponding DataList row after updating GridView row H5N1 Microsoft ASP .NET 0 27th Apr 2006 12:41 AM
GridView nested in DataList - refreshing corresponding DataList row after updating GridView row H5N1 Microsoft Dot NET Framework Forms 0 26th Apr 2006 07:46 PM
Help: Using Multiple Checkboxes or Checkboxlist to filter results in a gridview in ASP.NET 2.0 / VS2005 Faybert@gmail.com Microsoft ASP .NET 0 30th Dec 2005 12:43 AM
nested Repeaters with javascript checkboxes =?Utf-8?B?TWFjaGk=?= Microsoft ASP .NET 0 16th Apr 2004 06:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:25 AM.