#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Get Value of Checkbox in the Gridview


    Basically , I have a Gridview which retrieve data from access database , I have around 7 columns that contains T/F values.
    https://docs.google.com/open?id=0B4s...1JGYWpleHRLTjg

    I would like to get value of those specific row for those Values , and I try the following codes , and don't gave me the result , either show empty or an Error message which lead that is not write syntax to do that

    Code:
    MsgBox(GridView1.SelectedRow.Cells(15).Text)
    Which basically gave me empty message box <_< , and I try with it
    Code:
    Convert.ToBoolean(GridView1.SelectedRow.Cells(15).Text)
    The Error message shows
    https://docs.google.com/open?id=0B4s...EllV3k3MmdlUkU


    Still their more thing
    Code:
     MsgBox(GridView1.SelectedRow.Cells(15).value)
    don't worry , the error in way : 'Value'is not a memeber of 'system.web.ui.web.controls.tablecell'
    So, from that error , I figure it might should use control attributes


    Code:
     MsgBox(GridView1.SelectedRow.Cells(15).Controls.Item(0))
    Still gave me errors messages for syntax


    So, If you can lead me to the right code , please ..

    Thank you
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,424
    Rep Power
    4539
    This doesn't look like classic asp that I use. Maybe if you post the exact error you get someone who knows may jump in here, or if this is an asp.NET issue you could try the NET forum.
    ======
    Doug G
    ======
    The man who doesn't read good books has no advantage over the man who can't read them.
    --Mark Twain
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0
    This is my gridview,which some testing data being show.
    i had create the checkbox on everyrow,but now i face another problem
    what i want is when i click the Button,i can get the value in the gridview which being checked.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    18
    Rep Power
    0
    I didn't quite well understood the code you offered here. Or you may read something about gridview checkbox column, which might be helpful to your situation.

IMN logo majestic logo threadwatch logo seochat tools logo