Camila Piai

Camila Piai

  • NA
  • 7
  • 5.2k

datagrid - verify checkbox column

May 13 2012 4:06 PM
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)