Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: one delacruz
  
 
 
 one delacruz
 Tags
Subject: RE: grid's backcolor
Thread ID: 189325 Message ID: 189333 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Grids
Date: Thursday, August 14, 2008 12:27:20 PM         
   


> >
> > Does this example Message ID: 189103 do what you want when you use .DynamicBackColor instead of .DynamicForeColor?
> >
> >
> > hth
> > -Stefan
>
> Is it applicable to Grid's BackColor?

This one would use column.DynamicBackColor to display a red background for values < 100.
Is that close to what you want?


LOCAL oForm as Form
oForm = CREATEOBJECT('TestForm')
oForm.Show(1)
RETURN

DEFINE CLASS TestForm as Form
	AutoCenter = .T.
	PROCEDURE Load
		CREATE CURSOR temp (Col_a Int, Col_b Int, Col_c Int)
		INSERT INTO temp VALUES (100, 200, 500)
		INSERT INTO temp VALUES (150, 70, 500)
		INSERT INTO temp VALUES (20, 300, 600)
		GO TOP
	ENDPROC

	ADD OBJECT Grid1 as Grid WITH ;
		RecordSource = 'temp', ColumnCount = 3
	PROCEDURE Grid1.Init()
		LOCAL loColumn, lcField
		FOR EACH loColumn IN This.Columns
			lcField = JUSTEXT(m.loColumn.ControlSource)
			loColumn.DynamicBackColor = 'Iif(' + m.lcField + '<100,RGB(255,0,0),RGB(255,255,255))'
		NEXT
	ENDPROC
ENDDEFINE



hth
-Stefan

ENTIRE THREAD

grid's backcolor Posted by lopera @ 8/14/2008 12:10:51 PM
RE: grid's backcolor Posted by Mike Gagnon @ 8/14/2008 12:21:55 PM
RE: grid's backcolor Posted by Stefan Wuebbe @ 8/14/2008 12:22:02 PM
RE: grid's backcolor Posted by lopera @ 8/14/2008 12:23:45 PM
RE: grid's backcolor Posted by Stefan Wuebbe @ 8/14/2008 12:27:20 PM
RE: grid's backcolor Posted by Cetin Basoz @ 8/14/2008 12:22:13 PM