Link to home
Start Free TrialLog in
Avatar of MiddlesbroughPCT
MiddlesbroughPCTFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Set/Get checkbox value in Gridview

Hi all,

Hopefully a quick one, I have a normal Gridview with normal text columns but with one holding a checkbox for an "attended" field.  

What I'm after is that when this checkbox is ticked, on CheckedChanged event I want to update the database to say the course has been attended if the Checkbox is checked.

I can access the CheckedChanged event fine from within the Gridview, but I would like the checkbox to hold the ID of the course, so I can then automatically use a "Update tbl where ID = CHECKBOXVALUE".

I can only set the bound ID to either the Text or Checked parts of the Checkbox though, so the value is appearing alongside the Checkbox in the Gridview, which I don't want to be visable, is there a way to attach the value so I can use it but no have it display next to the checkbox?

Cheers
ASKER CERTIFIED SOLUTION
Avatar of Oliver Amaya
Oliver Amaya
Flag of Venezuela, Bolivarian Republic of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Meant to say in which row of the GridView the checkbox is situated.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MiddlesbroughPCT

ASKER

Both answers apply so split points, thanks for answering.