General information
Category:
Forms & Form designer
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only