Although the cellformatting event is nicely optimised to only work on visible rows on-screen - it seems to be also the same for cells that are off-screen.
Having 12-16 columns with several of these off-screen to the right of the visible cell/columns, I am setting the backgroundcolor property of a row style via a column/cell - the cellformatting does not fire... It fires and changes the row of the data once I scroll over to the right once the cell is visible...
To explain this better:
I have a datagridview with invoice information that I want to highlight in red when it a date in the row is within a couple of days of being outstanding. Now - the code works fine on my widescreen as all the columns show. Rows turn red as they should etc.
However, on a lower-resolution monitor, even when the form is maximised, my trigger-cell disappears off to the right and cellformatting doesnt pick it up and therefore does not paint the row red as it should.
I have tried having two hidden cells over to the left but it looks like cellformatting ignores invisible cells for obvious reasons (its not going to paint something invisible). The only alternative and then it gets ugly, is to move the date outstanding cell pretty much to within the first 2 or 3, maybe 4 columns instead of where it is at the moment.
I have tried a few searches in Google but I suspect I may be using the incorrect search term "datagridview cellformatting not working when cell is to the right" and it nothing that I can see useful for me.
I guess another solution, is to utilise my "invoice number" and do an on-the-fly query to check if the invoice record date is within the boundariesI have set ,but i was hoping not to do queries that are hitting the database while a user scrolls around either.
Is this a bug with .net ? Im using vb.net VS2015 with 4.6 of the framework.
or is there a non-paint-enabled "cellformatting type" event that also gets triggered so i can examine any cell contents otherwise the performance gain that DGV gets out of not looking at all cells means a much bigger hit (for me anyway) by having to query the database for every record, per page of records.
What I have tried:
Various google searches without success.