>I'm trying to set the text color in grid rows to certain colors depending on a particular criteria. SetAll works fine, but I'm having problems determining how to set more than two colors. I have the following code in the grid refresh and it works fine, but I have more than two "types" (see code) all of which I need in their own color.
>
>lcColorSpec = 'IIF(ALLTRIM(type)=="Pending",255,0)'
>This.SetAll("DynamicForeColor", lcColorSpec, "Column")
>
>So, what I'd like to do is to use something like SetAll to make it quick, but need to be able to evaluate each row in the grid individually and set the text forecolor to the appropriate color.
>
>Any suggestions?
>
>Thanks!
Mark,
The only way you can do this is with nested IIF()'s. Like;
lcColorSpec = 'IIF(ALLTRIM(type)=="Pending",RGB(255,0,0),;
IIF(ALLTRIM(Type)="Closed",RGB(0,255,0),RGB(0,0,0)))'
This.SetAll("DynamicForeColor", lcColorSpec, "Column")
You may have to nest even further if there are more possibilities.