I\'m developing a window application in C# VS2005. I have a dataGridView in which the first column has Checkboxes. Now i want the Column header also to be a CheckBox which i
So - to address the top-most checkbox not showing as checked (even though it is), I ended up editing your event as follows:
private void checkboxHeader_CheckedChanged(object sender, EventArgs e) { //CheckBox headerBox = ((CheckBox)dtgv1.Controls.Find("checkboxHeader", true)[0]);
var headerBox = (CheckBox)sender;
var b = headerBox.Checked;
var c = int.Parse(headerBox.Name.Replace("checkboxHeader", ""));
for (int i = 0; i < dgvSources_fuzzyID.RowCount; i++)
{
dgvSources_fuzzyID.Rows[i].Cells[0].Value = headerBox.Checked;
***dgvSources_fuzzyID.RefreshEdit();***
}
}
That is what finally fixed it for me...