Link to home
Start Free TrialLog in
Avatar of lapucca
lapucca

asked on

How to get if my gridview control's checkbox cell is checked?

Hi, I'm using VS2012.
In the row updating event, I need to see if user checked the checkbox.  In the gridview, 1st column is the auto generated Edit.  4 columns to the right is my checkbox column.  What index should I use, 4?  (edit button is 1?)  and code like this?
 dt.Rows[row.DataItemIndex]["IsComplete"] = ((CheckBox)(row.Cells[4].Controls[0])).Checked;

Also, what is the Controls[0]?  What index is it referring to with 0?

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Michael Fowler
Michael Fowler
Flag of Australia 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
Avatar of lapucca
lapucca

ASKER

Thank you