1
Answer

datagrid - verify checkbox column

Camila Piai

Camila Piai

12y
1.2k
1
I created a Checkbox column in a datagrid and added some rows.
But,  I cant  verity if the checkboxes were checked or not.
Here's the code:
 
                DataGridViewCheckBoxColumn column = new DataGridViewCheckBoxColumn();
                gridclass.Columns.Insert(0, column);
                gridclass.Columns[0].HeaderText = "Presença";

           

            for (int i = 0; i < linhas; i++)
            {
                gridclass.Rows.Add(gridclass.Rows[i].Cells[0].Value = true);
            }

 for (int i = 0; i < linhas; i++)
            {
                gridclass.Rows.Add(gridclass.Rows[i].Cells[0].Value = true);
            }

 if (gridclass.Rows[i].Cells[0].Value == true)
...

it says I cant use the operator "==". 
what can I do?
Answers (1)