I have a virtual DataGridView that has a data cache behind it.
Sometimes I update the values in the cache programatically and I want to be able to tell the DataGridView to refresh the cells.
That is, for it to trigger the CellValueNeeded event.
Currently I just make a call to DataGridView.Refresh() which invalidates the entire DataGridView and repaints it - which includes triggering the CellValueNeeded event.
There are problems with this though. Firstly, it seems a somewhat brute force method. I don't really need to repaint the whole thing...
Secondly, I have had intermittent Nullreference exceptions down in the GDI layer when I do a refresh. Not fun.
Anyone have any ideas?
Regards
Jero
↧
Forcing a virtual DataGridView to refresh its Cell values
↧