>>Hi Peter.
>>
>>It's possible to change the colour of fonts or whatever
>>in columns of Grid.
>>
>>See Dynamicforecolor and DynamicBackColor.
>>
>>For example
>>
>>Grid.Column(n).Dynamicforecolor = ;
>> 'IIF(myTbl.sum = 6 ,RGB(255,0,0),RGB(0,0,255))'
>>
>>Grid.Column(n).DynamicBackcolor = ;
>> 'IIF(myTbl.sum = 6 ,RGB(0,0,0),RGB(255,255,255))'
>>
>>The code above would make column(n)'s font color RED
>>and back color BLACK if myTbl.sum is 6.
>>
>>Good Luck .
>
>
>Dear Mr. Park,
>
>I came across this little pearl also and naturally tried to massage it a little.
>
>Grid.Column(n).Dynamicforecolor = ;
> 'IIF(myTbl.sum = 6 ,RGB(255,0,0),RGB(0,0,255))'
>
>I would like the "rgb(255,0,0)" to be as dynamic as the "myTbl.sum = 6 ". So I created a field in the view that runs the grid to hold the color of the backcolor I would like the field to be displayed in ie:
>
>Grid.Column(n).Dynamicforecolor = ;
> 'IIF(v_apptbookframe.'REC' ,RGB(v_apptbookframe.ccolor_1),RGB(0,0,255))'
>
>This doesn't bomb but the grid does not colorize.
>
>If you store '255,0,0' to testcolor
>Then substitute testcolor for the rgb clause ie:
>
>Grid.Column(n).Dynamicforecolor = ;
> 'IIF(v_apptbookframe.'REC' ,rgb(&testcolor) ,RGB(0,0,255))'
>
>this runs but then if you try the same thing with the view variable ie:
>
>Grid.Column(n).Dynamicforecolor = ;
> 'IIF(v_apptbookframe.'REC' ,rgb(&v_apptbookframe.ccolor_1) ,RGB(0,0,255))'
>the grid does not get colorized.
>
>
>Any ideas?
>
>NeilGorin
>Dadigidoc@aol.com
What does v_apptbookframe.ccolor_1 contain ? Char or numeric ? If char like "255,255,0" then try :
"iif(v_apptbookframe.REC, rgb("+v_apptbookframe.ccolor_1+"),rgb(0,0,255))"
Else try with str(v_apptbookframe.ccolor_1) instead of RGB().
You cannot macro substitute like &v_apptbookframe.ccolor_1. If you want to evaluate that way then try :
"iif(v_apptbookframe.REC, eval('rgb('+v_apptbookframe.ccolor_1+')'),rgb(255,0,0))"
Cetin