Datagrid
how to generate events for datagrid checkboxes
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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
Akkiraju IvaturiRank #473 · 5.3K reputationPosted Aug 24, 2012, 9:58 PM EDT
http://www.codeproject.com/Articles/6815/Handling-events-of-child-controls-inside-a-DataGri
anil john153 reputationPosted Aug 24, 2012, 10:19 PM EDT
Akkiraju IvaturiRank #473 · 5.3K reputationPosted Aug 24, 2012, 10:47 PM EDT
Anyways there is no direct way to handle the click event on check box. You have to handle the click event on the grid and find out what column and cell has been clicked and then identify the check box and then check/uncheck the check box.
void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0) { bool isChecked = (Boolean) dataGridView1[0, e.RowIndex].FormattedValue; if (isChecked) dataGridView1[1, e.RowIndex].Value = true; } }Akkiraju IvaturiRank #473 · 5.3K reputationPosted Aug 24, 2012, 10:48 PM EDT