Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I dynamically change one cell in a grid?
Message
From
09/08/2001 16:59:18
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00542012
Message ID:
00542025
Views:
32
Nadya-

>If there are bunch of cases, create a method of your form, called MyColor
>column1.DynamicBackColor="thisform.myColor(MyTable.MyField)"
>
>and put this code into MyColor method:
>
>lparameter tValue
>local lnColor
>do case
>   case tValue=x
>       lnColor=rgb(....) && Red
>   case tValue=y
>       lnColor=rgb(...) && Blue
>    etc...
>endcase
>return m.lnColor
I'm being dense about something. When I try something like this:
*!* Temp.MyGetColor()
LPARAMETERS tvValue
DO CASE
	CASE tvValue = "31011     "
		ln = RGB(255,0,0)
	CASE tvValue = "31036     "
		ln = RGB(128,255,0)
	OTHERWISE
		ln = RGB(128,0,128)
ENDCASE
RETURN ln
I get an error. The error depends how I've set the dynamicbackcolor property. However, neither way works. The indication it's an invalid value for the property. What am I doing wrong?

If I set th property like so =thisform.GetMyColor(EVAL(this.controlsource)), method executes as I expect but when it returns I get the error: Error loading file...DynamicBackColor: Data type is invalid for this property

If I set the property as you suggest: thisform.GetMyColor(EVAL(this.controlsource)) I get Expression is invalid. Use a valid expression for DYNAMICBACKCOLOR property and the method is not even called.

Neither works, of course.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform