>Hi all
>
>In my grid class I have a ProcessColumn() method to go through each column and set it's DynamicBackColor. I have managed to reach 190 characters:
>
.DYNAMICBACKCOLOR = "IIF((NOT EMPTY(RECNO('" + THIS.RECORDSOURCE + "'))) AND (THIS." ;
> + .NAME + ".ENABLED AND (NOT THIS." + .NAME ;
> + ".READONLY)), goApp.nBackColorFld, " ;
> + "IIF(goApp.nOSVersion < 5.01, goApp.nBackColorForm, THIS.BACKCOLOR))"
>
>Now I need to add one more condition for columns that contain a class which range checks numeric values entered by the user and need a different color if the range check fails.
>
>Is this the only way to keep piling in IIF() for this or can I do something better?
>
>Thanks and regards.
Bhav,
1. You can use ICASE()
2. You can use form's (or grid's) method to return a proper color - this way you have no limitation
3. You can use TEXT/ENDTEXT to write the BackColor expression.
If it's not broken, fix it until it is.
My Blog