>Hi Nick.
>
>
>Is there a way to do the following:
>
>I have a grid that lists members of a national association with the rows being colored as to type of member. When I use grid highlighter, I lose the previously set rowcolors. I tried using cCustomCondition = 'this.setMemberColor()', lCustomCondition = .t., but I keep having problems.
>
>I could really use the help, as I spent about 8 hours yesterday, trying to figure this out.
>
>Thanks...
Hi John,
Sure there is.
Drop your custom condition - it is for simple conditions only. (Reset .cCustomCondition and .lCustomCondition to default).
Let's say, you have a custom function my_color(). I am not sure where your .setMemberColor() method belongs to, but you can use it with proper addressing instead.
LPARAMETER tnValue
LOCAL lnColor
DO CASE
CASE tnValue = 3
lnColor = RGB(0,255,255)
CASE tnValue = 4
lnColor = RGB(255,0,0)
CASE tnValue = 5
lnColor = RGB(0,255,0)
CASE tnValue = 6
lnColor = RGB(0,0,255)
CASE tnValue = 7
lnColor = RGB(255,255,0)
OTHERWISE
lnColor = RGB(255,255,255)
ENDCASE
RETURN lnColor
Put into the Gridhighlighter1.onPostSetDynamicColor() method the following:
cHost = .cHostname
THIS.PARENT.&cHost..SetAll("DynamicBackColor",;
"IIF(RECNO('your_grid_record_source')= this.parent.Gridhighlighter1.nRecno,EVAL(this.parent.gridHighlighter1.cHighBackColor),my_color(your_key_value_field_here))","Column")
You may not use SetAll if you don't want to, but set the DynamicBackColor for certain columns only.
You can use the same way for records forecolor.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison