Setting Cell Forecolor gotcha

I have a dataGridView that can display row text in any of 4 colors depending on the object's status. I was setting the cell text in the CellFormatting event, and occasionally it would freak out, and start invalidating the desktop (which would force a repaint of the grid, which would invalidate the desktop, and so forth), until I resized the form (and grid), or hid it.

I changed my code to check the current text color, and only change it if it's not already the appropriate color, and my app is much happier.

[529 byte] By [mpswaim] at [2008-1-4]