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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Gohil JayendrasinhRank #490 · 5K reputationPosted Oct 2, 2012, 5:00 AM EDT
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/
Shivaraj Poojary69 reputationPosted Oct 2, 2012, 6:52 AM EDT