In my project i have datagridview with checkbox in the first column....I would like to know how to check if the checkbox is checked or not..
Please help me
Thanks in Advance
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shivaraj PoojaryPosted Oct 2, 2012, 10:52 AM
Gohil JayendrasinhPosted Oct 2, 2012, 9:00 AM
if you use TemplateField ASP checkbox then
OnCheckedChanged="chkStatus_OnCheckedChanged"
public void chkStatus_OnCheckedChanged(object sender, EventArgs e)
{
CheckBox chkStatus = (CheckBox)sender;
GridViewRow row = (GridViewRow)chkStatus.NamingContainer;
string cid = row.Cells[1].Text;
bool status = chkStatus.Checked;
}
For more information inline-editing-and-updating in gridview with check-box
http://www.c-sharpcorner.com/uploadfile/jayendra/inline-editing-and-updating-in-gridview-with-check-box/