i have this code and it kinda works but not properly.
i need it to look at the coloum in a datagrid and make the back colour red if over 1.6(in sql this field is saved as Varchar(10))
but at the min, i have a value of 1.5 and it is making the back colour red
Dim cell As DataGridViewCell
Dim CellVar As Integer
For Each row As DataGridViewRow In Me.OEEGrid.Rows
cell = row.Cells("CD")
CellVar = CInt(row.Cells("CD").Value)
If CellVar >= 1.6 Then
' cell.Style.ForeColor = Color.Red
cell.Style.BackColor = Color.Red
Else
cell.Style.ForeColor = Color.Black
End If