Is it possible to vary the colour of individual cells in a grid according to the contents of that cell?
Keith
Keith
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
thisform.Grid1.Column1.DynamicBackColor = "IIF(SomeCondition,RGB(color you want when SomeCondition is True),RGB(color you want when SomeCondition is False))"
thisform.Grid1.Column1.DynamicBackColor = "thisform.GetColor()"
*** thisform.GetColor method:
LOCAL liColor
DO CASE
CASE Condition1
liColor = RGB(....) && Some color
CASE Condition2
liColor = RGB(....) && color2
CASE Condition3
liColor = RGB(....) && color 3
.....
CASE ConditionN
liColor = RGB(....) && Color N
OTHERWISE
liColor = thisform.Grid1.Column1.BackColor
ENDCASE
RETURN liColor
WITH TheGrid
.Refresh
.ActivateCell(.ActiveRow, .ActiveColumn + 1)
.ActivateCell(.ActiveRow, .ActiveColumn - 1)
ENDWITH
I place the following statement into the Refresh methjod of the grid.