I want to check all/ only certain Checkboxes as checked. I tried various versions from stackoverflow but none seem to work out. The code is called directly after dynamically creating the datagrid as I only want to load the Data once. - Datagrid is created in my Form_Load The value of the Checkboxes are changed but not displayed.
//This is how i create the Datagrid column - not question relevant
for (int kacnt = 1; kacnt <= Ei.Kaanzahl; kacnt++)
{
DataGridViewCheckBoxColumn Kachk = new DataGridViewCheckBoxColumn();
Kachk.HeaderText = "Kamera" + kacnt;
Kachk.Width = 70;
WarDataGridView.Columns.Add(Kachk);
}
// The code I actually have problems with - the display of the value
foreach (DataGridViewRow row in WarDataGridView.Rows)
{
for (int col = 1; col < WarDataGridView.ColumnCount; col++)
{
(WarDataGridView.Rows[row.Index].Cells[col] as DataGridViewCheckBoxCell).Value = true;}}