Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Colors on a grid
Message
From
11/02/2017 10:19:28
 
 
To
10/02/2017 14:18:21
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01647843
Message ID:
01647851
Views:
72
*test form for over 500 records (550) and dynamibackcolor property speed
*dynamicBackcolor applied to grid colums
*The speed is normal for VFP9 and dont slow visibilly. VFP8 might be the same behavior.
*can also  try to change dynamicolor property at runtime(add a button to form)....

publi oform
oform=newObject("asup")
oform.show
read events
retu
*
DEFINE CLASS asup AS form
	Top = 0
	Left = 0
	Height = 429
	Width = 880
    autocenter=.t.
    showWindow=2
	Name = "Form1"

	ADD OBJECT grid1 AS grid WITH ;
		Anchor = 15, ;
		Height = 433, ;
		Left = 1, ;
		Top = 0, ;
		Width = 877, ;
		Name = "Grid1"

	PROCEDURE Destroy
		use in select("ycurs")
		dele file ycurs.dbf
		clea events
	ENDPROC

	PROCEDURE grid1.Init
		_screen.windowstate=1
		close data all
		sele * from home(1)+"samples\data\customer" into  table ycurs1
		sele * from home(1)+"samples\data\customer" into  table ycurs2
		sele * from home(1)+"samples\data\customer" into  table ycurs3
		sele * from home(1)+"samples\data\customer" into  table ycurs4
		sele * from home(1)+"samples\data\customer" into  table ycurs5
		sele * from home(1)+"samples\data\customer" into  table ycurs6

		*create a new table
		sele ycurs1
		copy stru to ycurs.dbf

		use ycurs alias ycurs
		sele ycurs
		appe from "ycurs1.dbf"
		appe from "ycurs2.dbf"
		appe from "ycurs3.dbf"
		appe from "ycurs4.dbf"
		appe from "ycurs5.dbf"
		appe from "ycurs6.dbf"
		close data all

		*clean
			for i=1 to 6
			dele file  ("ycurs"+trans(i)+".dbf")
			endfor
		*populate the grid
		use ycurs alias ycurs
		sele ycurs
		with this
		.recordsource="ycurs"
		.recordsourcetype=1
		.deletemark=.f.
		.gridlines=0
		.autofit()
		.SetAll("DynamicBackColor", "IIF(MOD(RECNO( ), 2)=0, RGB(212,210,208) , RGB(0,255,0))","column")
		.Column3.DynamicBackColor = "rgb(255,164,164)"
		.column5.Dynamicbackcolor ="rgb(255,255,0)"
		.column3.fontbold=.t.
		.column3.forecolor=rgb(128,0,64)
		locate
		.parent.caption=trans(reccount())+ " records loaded"
		endwith
	ENDPROC

ENDDEFINE
*
*-- EndDefine: asup
Previous
Reply
Map
View

Click here to load this message in the networking platform