Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I dynamically change one cell in a grid?
Message
 
 
To
09/08/2001 16:30:23
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00542012
Message ID:
00542019
Views:
23
>Hi all. Im building a small app for a visually impaired person and would olike to know how to change the backcolor of a cell in a grid depending upon its value. There would be 4 possible different values but it can work like "red if value=x, green if value<>x".
>TIA
>Ulises.

If there are only two cases, you should use column1.DynamicBackColor="iif(myTable.MyField=x,rgb(255,255,255),rgb(128,128,128)).

If there are bunch of cases, create a method of your form, called MyColor
column1.DynamicBackColor="thisform.myColor(MyTable.MyField)"

and put this code into MyColor method:
lparameter tValue
local lnColor
do case
   case tValue=x
       lnColor=rgb(....) && Red
   case tValue=y 
       lnColor=rgb(...) && Blue
    etc...
endcase
return m.lnColor
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform