Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Getting the Value of a Checkbox in the GridView Selected Row

Reply
Thread Tools

Getting the Value of a Checkbox in the GridView Selected Row

 
 
Kirk
Guest
Posts: n/a
 
      03-06-2007
I have a GridView that displays several columns, one of which is a
checkbox field. This is populated at runtime from a SqlDataSource and
is not enabled (the user can't change it's value). I have turned on
the "Enable Selection" option, and I know I can identify what is the
currently selected row.

How can I get the value [True/False] of the checkbox in the selected
row? For columns that are just text, this works:

System.Diagnostics.Trace.WriteLine(Me.GridView1.Se lectedRow.Cells(3).Text)

...but it does not work on a column that is a checkbox (returns nothing
since there is no text in that column). I have tried to use the Ctype
method to cast the column as a checkbox, but I can't get that to work
either.

I realize that I am missing something stupid, and I would appreciate a
tip or suggestion.
Thank you!

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Getting selected values from gridview (checkbox) and inserting the Id in the database stavo23 ASP .Net 0 02-26-2008 03:26 PM
Getting the Value of a Checkbox in the GridView Selected Row Kirk ASP .Net 2 03-06-2007 03:37 PM
Want to add row under selected row of gridview ujjc001@gmail.com ASP .Net Building Controls 1 02-16-2007 07:14 PM
Selected Row Only GridView Row Visible? needin4mation@gmail.com ASP .Net Web Controls 0 10-17-2006 10:07 PM
Getting data from a selected row in a gridview Neil ASP .Net 0 11-11-2005 03:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57