DataGridView and CheckBox

Sep 9 2010 4:23 AM
I am writing a C# method that reads and shows an XML file into a datagridview. The datagridview's got a checkbox column (DataGridViewCheckBoxColumn) that should be checked if an attribute of the XML nodes is true. I don't know how to check the box unfortunately, I tryed a lot of solutions like:

dataGridView1.Rows[i].Cells["Column1"].Value = 1; //Column1 is the DataGridViewCheckBoxColumn
dataGridView1.Rows[i].Cells["Column1"].Value = true; //Column1 is the DataGridViewCheckBoxColumn

I also tryed to set TrueValue and FalseValue in this way:

Column1.TrueValue = 1;
Column1.FalseValue = 0;

As you can guess, no luck with that. I mean the Value property actually works but when I start the Form, the checkbox is not checked like it should be.

What can I do? 

Answers (1)