How can i set checked and uncheck checkbox column in Gridvie
How can i set checked and uncheck checkbox column in DataGridview.

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 attend5days leftRegister
Khargesh RajputRank #616 · 3.9K reputationPosted Mar 30, 2015, 8:52 PM EDT
{
foreach (DataGridViewRow row in dataGridView1.Rows)
{
DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells[1];
// set cell index of your checkbox position in datagrid
if (chk.Value == chk.TrueValue)
{
chk.Value = chk.FalseValue;
}
else
{
chk.Value = chk.TrueValue;
}
}
}
Afzaal Ahmad ZeeshanRank #60 · 27.6K reputationPosted Mar 29, 2015, 10:06 AM EDT
checkBox.Checked = true;
Read this MSDN guide for more.
Feroz Khan69 reputationPosted Mar 29, 2015, 10:41 AM EDT
Feroz Khan69 reputationPosted Mar 31, 2015, 2:48 AM EDT
ok
how can i add checkbox column in datagridview...
Khargesh RajputRank #616 · 3.9K reputationPosted Mar 31, 2015, 2:53 AM EDT
http://www.c-sharpcorner.com/UploadFile/deveshomar/adding-checkbox-column-in-datagridview-in-C-Sharp-window-forms/
Feroz Khan69 reputationPosted Mar 31, 2015, 5:00 AM EDT
Column added but checked mark is not showing you know like right mark and unmark..
like checked and unchecked.... and data is coming from database i dont want to put in code manually... just checked and unchecked is not showing..