Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid - Showing Selected Record in Differenct Color
Message
From
15/07/1999 21:57:34
 
 
To
12/07/1999 15:47:19
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00239661
Message ID:
00242118
Views:
22
Hi Harry,

I have the code in the init of the grid. If it helps, I did something similar in another grid in its init:

This.SetAll('DynamicForeColor','iif(Retrain(TrnFld2Dte(eval("TRNFILE."+cField))),rgb(140,0,0),rgb(0,100,0))','Column')

where Retrain is a udf that checks if an employee needs to be retrained (red) or not (green).


>>I've used this quite extensively in a grid to get different background colours depending on the cell's value and it works quite well for me as in:
>>MyColumn.dynamicBackcolor='iif(left('+f+',1)="S",rgb(220,255,220),'+;
>> 'iif(left('+f+',1)="X",rgb(240,240,240),'+;
>> 'iif(left('+f+',1)="L",rgb(210,240,255),'+;
>> 'iif(left('+f+',1)="*",rgb(255,220,220),rgb+;
>> (255,255,255)))))'
>>where f is a string containing the field name.
>>I think you may be running into a problem because of where you are placing your code - ie within the textbox valid vs in the grid init event as in both examples. The reason I used f in my example was because it involved 210 different fields.
>
>so where do you place your code?
>I've so far tried the textbox valid, the grid init and the grid refresh
Previous
Reply
Map
View

Click here to load this message in the networking platform