Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid DynamicBackColor
Message
From
22/01/2008 10:52:42
 
 
To
22/01/2008 10:41:14
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01283894
Message ID:
01284060
Views:
9
>For me, this is invalid for a DynamicBackColor formula.
>
>I was able to finally resolve this by manipulating my data and using this:
>
>
>="IIF( .T., RGB(b_red,b_green,b_blue), 0)"
>
>
>Where, b_red, b_green and b_blue are fields in my cursor. I have no idea why it has to be this way. These Dynamic colors are finicky as hell. Same with the RGBComp() function that Marcia told me about. Got it working, but it wasn't easy.
>
>>Is MyCursor the RecordSource for the grid? If not, you can try to specify it in your IIF() statements.
>>
="IIF( .T., MyCursor.Sch_BackColor, 0)"
This works for me coming from a different cursor than the RowSource.
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


	**************************************************
*-- Form:         form1 (c:\vfp9stuff\grddynamic.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   01/22/08 08:50:08 AM
*
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT grid1 AS grid WITH ;
		Height = 121, ;
		Highlight = .F., ;
		HighlightRow = .T., ;
		Left = 48, ;
		Top = 48, ;
		Width = 277, ;
		AllowCellSelection = .F., ;
		Name = "Grid1"


	PROCEDURE Load
		CREATE CURSOR grdcolor (c1 i, c2 i)
		INSERT INTO grdcolor VALUES (RGB(255,0,0),RGB(0,0,255))
		CREATE CURSOR test (f1 c(10))
		INSERT INTO test VALUES ("one")
		INSERT INTO test VALUES ("two")
		INSERT INTO test VALUES ("three")
		GO TOP
	ENDPROC


	PROCEDURE grid1.Init
		this.Columns(1).dynamicbackcolor="IIF(RECNO()%2=1,grdcolor.c1,grdcolor.c2)"
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform