I am pulling three coloums of data from a SQL view into my data drid Day,TimeIn,Timeout
I want to colour my datagrid rows red if timeout is null and green if both the timein, timeout have data in them.
here is my code so far, but it aint working
Public Sub Datagridcolours()
'Sets datagrid row colours
Dim cell As DataGridViewCell
Dim CellVar As String
For Each row As DataGridViewRow In Me.DGVClockins.Rows
Dim x As String = row.Cells("ClockOUT").ToString
cell = row.Cells("CLOCKOUT")
CellVar = row.Cells("ClockOUT").ToString
Select Case x
Case IsDBNull(x)
cell.Style.BackColor = Color.Red
cell.Style.ForeColor = Color.White
End Select
Next
End Sub
hope someone out there can help me.
thanks in advance.