Hello,
I would like to confirm whether you are using
C1Flexgrid or C1TrueDBGrid. In case you are using
C1Flexgrid, you may use the OwnerDrawCell Event to implement the desired
behavior.
1. Fist you need to set the DrawMode property of
C1Flexgrid to OwnerDraw.
me.C1FlexGrid1.DrawMode =
C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw
2. Now in the OwnerDrawCell event of C1FlexGrid, you may use the
code something like this:
If Me.C1FlexGrid1(e.Row, "Country") = "UK" Then
e.Style.BackColor = Color.Red
e.Style.ForeColor = Color.White
ElseIf Me.C1FlexGrid1(e.Row, "Country") = "Germany" Then
e.Style.BackColor = Color.Black
e.Style.ForeColor = Color.White
Else
e.Style.BackColor = Color.Green
e.Style.ForeColor = Color.White
End If
I hope this
helps.
Regards,
Allen Smith
I am loading my data into the datasource property of the grid from a
binding source during the form load. As the rows load into the grid, I
would like to test a certain column in each row being loaded and depending on
the value in that column set the background color of the row to a different
color ex. red, green or yellow. This must be a simple matter because I
could do it in previous versions of TrueGrid in vb 6.
http://helpcentral.componentone.com/cs/forums/p/75107/204414.aspx#204414