Checkbox in the Datagridview not updating

Kiran picture Kiran · Dec 3, 2012 · Viewed 7k times · Source

I am using a Datagridview in a winform and using Virtual Mode to populate the unbound data.

I have a checkbox header, with a static checkbox. When I click on the checkbox, all the checkbox status is toggled.

However, the check status is not refreshed. I need to hover over the Datagridview to refresh the status of the checkbox.

When earlier, the Virtual mode was set to false, I was not having this problem. Any idea, if I am missing something.

enter image description here

Answer

nfree25 picture nfree25 · Mar 3, 2015

What worked for me:

this.dataGridView2.CurrentCell = null (thanks silent winter)

or

this.dataGridView2.RefreshEdit();
this.dataGridView2.Refresh();