This is a really dumb question, and I know there is an easy solution, but either I am too tired or too dumb to see it...
I want to check for values and color code cells in my Datagrid based on the value, this works great for my red, but when I do yellow, it colors all cells yellow because I am not establishing my parameters correct...
I know I am mising an easy solution here, but I need a 2nd pair of eyes to see it for me, thanks everyone!
Kai-What?
I want to check for values and color code cells in my Datagrid based on the value, this works great for my red, but when I do yellow, it colors all cells yellow because I am not establishing my parameters correct...
Code:
'Conditional Formatting for Out of Spec - Length Top XD (Red):
If Not LengthTopXD.Equals(DBNull.Value) Then
If Convert.ToDecimal(LengthTopXD) < 5.0201 Then
e.Item.Cells(3).BackColor = Color.Red
End If
If Not LengthTopXD.Equals(DBNull.Value) Then
If Convert.ToDecimal(LengthTopXD) > 5.0397 Then
e.Item.Cells(3).BackColor = Color.Red
End If
'Conditional Formatting for Marginal - Length Top XD (Yellow):
If Not LengthTopXD.Equals(DBNull.Value) Then
If Convert.ToDecimal(LengthTopXD) >= 5.0201 <= 5.02209999999 Then
e.Item.Cells(3).BackColor = Color.Yellow
End If
End If
If Not LengthTopXD.Equals(DBNull.Value) Then
If Convert.ToDecimal(LengthTopXD) >= 5.03770000001 <= 5.0397 Then
e.Item.Cells(3).BackColor = Color.Yellow
End If
End If
I know I am mising an easy solution here, but I need a 2nd pair of eyes to see it for me, thanks everyone!
Kai-What?