Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Forcing a virtual DataGridView to refresh its Cell values

$
0
0

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


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>