Re: Coloring a DataGridView Row, when a number goes below a certain number
Posted 22 March 2011 - 05:38 AM
If you want to change the color of one cell it is possible to subscribe to the OnCellPaint event of the DataGridView. For an entire row you can subscribe to the OnRowPrePaint event to manipulate the entire row. This way you don't have to loop through the entire dataset again. (the dataset gets looped through when the grid gets drawn to the screen).
Parse the content of the cell by checking e.Value and when necessary, change the brush color and/or pen color
Parse the content of the cell by getting the e.RowIndex and checking the appropiate cell
Hope this helps,
This post has been edited by Rico Diesel: 22 March 2011 - 05:39 AM