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;
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?

Mamta MPosted Sep 9, 2010, 5:54 AM
I tested the code and what I find is that if the datagridview is unbound, ie, it has only the checkboxcolumn, it's working perfectly fine. This means that it is the data binding with the XML file that's causing an issue. How are you binding to the file? Can you paste the code here?