Hello,
I have a Radgrid.
What i want to do is, that when a numeric value is negative it should be in forecolor red. This is not the Problem.
But when i group the grid by any of the header other values have forecolor red although the value is not negative and its fieldname is not "erfolg" or "erfolgprozent".
My code is:
If TypeOf e.CellElement.ColumnInfo Is GridViewDataColumn Then
If DirectCast(e.CellElement.ColumnInfo, GridViewDataColumn).FieldName.ToLower = "erfolg" Or DirectCast(e.CellElement.ColumnInfo, GridViewDataColumn).FieldName.ToLower = "erfolgprozent" Then
If IsNumeric(e.CellElement.Value) Then
If CDbl(e.CellElement.Value) < 0 Then
e.CellElement.ForeColor = System.Drawing.Color.Red
Else
e.CellElement.ForeColor = System.Drawing.Color.Black
End If
End If
End If
End If