I have my Grid Column's DynamicBackColor partially working, but I could use some advice/clarification on getting the remainder to work.
I understand that the value of DynamicBackColor is a String which I guess is executed as a macro somewhere along the line.
Currently I have the Row background color changing as desired based on two possible 'trigger' conditions with the following code:
.DYNAMICBACKCOLOR = ;
'IIF(chk.flag, RGB(240,250,0), ;
IIF(chk.changed, RGB(253,255,213), RGB(255,255,255)))'
Now in addition to the above I also want to change the background color of an individual cell within that same row if it's column's ControlSource = 'Trigger' Field.
To do that I need to make a check of the Column's ControlSource and compare it to a known value within the CHK table.
To attempt to do that I expanded the above working code to the following:
.DYNAMICBACKCOLOR = ;
"IIF(chk.flag AND ALLTRIM(UPPER(chk.Flag_Fld)) == ALLTRIM(UPPER(" + mcFldName + ")), RGB(255,0,0),;
IIF(chk.flag, RGB(240,250,0),;
IIF(chk.changed, RGB(253,255,213), RGB(255,255,255))))"
The above code generates an error on execution
Expression is invalid. Use a valid
expression for DYNAMICBACKCOLOR
property.
This code is executed during the dynamic build of the Grid and the value of mcFldName is what is used to set the individual column's ControlSource during the build.
SELECT MyTable
mnFldCnt = AFIELDS(aryFlds)
THISFORM.GRID.COLUMNCOUNT = mnFldCnt
FOR i = 1 TO mnFldCnt
mcFldName = aryFlds(i,1)
mcControlSource = ALIAS() + "." + mcFldName
WITH THISFORM.GRID.COLUMNS
.CONTROLSOURCE = mcControlSource
.DYNAMICBACKCOLOR = ;
<etc., etc....>
WITH
ENDFOR
Can you see what it is about my Expression which is InValid?
Thanks,
JRB-Bldr
I understand that the value of DynamicBackColor is a String which I guess is executed as a macro somewhere along the line.
Currently I have the Row background color changing as desired based on two possible 'trigger' conditions with the following code:
.DYNAMICBACKCOLOR = ;
'IIF(chk.flag, RGB(240,250,0), ;
IIF(chk.changed, RGB(253,255,213), RGB(255,255,255)))'
Now in addition to the above I also want to change the background color of an individual cell within that same row if it's column's ControlSource = 'Trigger' Field.
To do that I need to make a check of the Column's ControlSource and compare it to a known value within the CHK table.
To attempt to do that I expanded the above working code to the following:
.DYNAMICBACKCOLOR = ;
"IIF(chk.flag AND ALLTRIM(UPPER(chk.Flag_Fld)) == ALLTRIM(UPPER(" + mcFldName + ")), RGB(255,0,0),;
IIF(chk.flag, RGB(240,250,0),;
IIF(chk.changed, RGB(253,255,213), RGB(255,255,255))))"
The above code generates an error on execution
Expression is invalid. Use a valid
expression for DYNAMICBACKCOLOR
property.
This code is executed during the dynamic build of the Grid and the value of mcFldName is what is used to set the individual column's ControlSource during the build.
SELECT MyTable
mnFldCnt = AFIELDS(aryFlds)
THISFORM.GRID.COLUMNCOUNT = mnFldCnt
FOR i = 1 TO mnFldCnt
mcFldName = aryFlds(i,1)
mcControlSource = ALIAS() + "." + mcFldName
WITH THISFORM.GRID.COLUMNS
.CONTROLSOURCE = mcControlSource
.DYNAMICBACKCOLOR = ;
<etc., etc....>
WITH
ENDFOR
Can you see what it is about my Expression which is InValid?
Thanks,
JRB-Bldr