compguru910
Well-known member
- Joined
- Nov 25, 2009
- Messages
- 47
- Programming Experience
- 3-5
Ok, Ive got a loop that is supposed to run through my datagridview and set the background color. I can get it to see the value in the cell, but it doesnt seem to run through the whole datagridview. Here is my code.
Thanks in advanced for the help
VB.NET:
Public Sub ColorRows()
For Each row As DataGridViewRow In dgvMain.Rows
Select Case row.Cells(4).Value
Case Is > Now
row.DefaultCellStyle.BackColor = Color.IndianRed
Case Is = Now
row.DefaultCellStyle.BackColor = Color.CadetBlue
Case Else
row.DefaultCellStyle.BackColor = Color.Green
End Select
Next
End Sub
Thanks in advanced for the help