Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Rows HighLighting With Property Grid.RelativeRow
Message
De
21/07/2005 03:39:14
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01034354
Message ID:
01034571
Vues:
23
>Hi Friends !
>
>Is it Possible to do a selective Grid Rows HighLighting using the grid property RelativeRow.
>
>I try in both Form Show Method and in the Refresh of the Grid:
>
>ThisForm.Grid1.SetAll("dynamicbackcolor", ;
> "IIF((ThisForm.Grid1.RelativeRow)%2 = 0,RGB(255,255,0), RGB(255,255,255))", "Column")
>
>But dont´t works ok.
>
>Someone already use satisfactoy this property to highlighting the odd rows of the grid ?
>
>Thanks in advance,
>
>Dionísio

Studied the output of this code and you will understand that RelativeRow
it is not usable inside the DynamicXXXXX
PUBLIC oform1

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

DEFINE CLASS form1 AS form


	Top = 0
	Left = 0
	Height = 314
	Width = 479
	DoCreate = .T.
	Caption = "Form1"
	BindControls = .F.
	AllowOutput = .F.
	Name = "Form1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 16, ;
		Left = 274, ;
		Height = 27, ;
		Width = 90, ;
		Caption = "No  focus", ;
		Name = "Command1"


	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 16, ;
		Left = 372, ;
		Height = 27, ;
		Width = 72, ;
		Caption = "Focus", ;
		Name = "Command2"


	ADD OBJECT grid1 AS grid WITH ;
		ColumnCount = 1, ;
		Height = 200, ;
		Left = 50, ;
		Top = 68, ;
		Width = 320, ;
		Name = "Grid1", ;
		Column1.Name = "Column1"


	ADD OBJECT command3 AS commandbutton WITH ;
		Top = 18, ;
		Left = 50, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "BIND", ;
		Name = "Command3"


	PROCEDURE showinfo
		debugout "RECNO()",RECNO(),"     relativerow",THISFORM.GRID1.RelativeRow
	ENDPROC


	PROCEDURE Load
		ACTIVATE WINDOW "Debug Output"
		CREATE CURSOR testGrid (f1 i)
		FOR k=1 TO 100
			APPEND BLANK
		NEXT
		LOCATE
	ENDPROC


	PROCEDURE command1.Click
		debugout "***** NO FOCUS REFRESH *****"
		DEBUGOUT "GRID'S RELATIVEROW == 0"
		thisform.grid1.Refresh	&& sync grid
		debugout "***** FORM PAINT FIRE ANOTHER CYCLE *****"
		DOEVENTS FORCE && FLUSH THE PAINT QUEUED
		debugout "***** NO FOCUS END *****"
	ENDPROC


	PROCEDURE command2.Click
		DEBUGOUT "***** SET FOCUS *****"
		DEBUGOUT "GRID'S RELATIVEROW == RELATIVEROW OF THE SELECTED ROW"
		thisform.grid1.SetFocus
		DEBUGOUT "***** IN FOCUS *****"
		DEBUGOUT "GRID'S RELATIVEROW == RELATIVEROW OF THE SELECTED ROW"
		thisform.grid1.Refresh
		debugout "***** REFRESH END *****"
		debugout "***** FORM PAINT FIRE ANOTHER CYCLE  *****"
		DOEVENTS FORCE && FLUSH THE PAINT QUEUED
		debugout "***** LOST FOCUS DO A DYNAMIC ON THE SELECTED ROW  *****"
		this.SetFocus
	ENDPROC


	PROCEDURE grid1.Init
		THIS.SetAll("dynamicFontShadow","thisform.showInfo()")
	ENDPROC


	PROCEDURE command3.Click
		DEBUGOUT "***** recoursource binding ****"
		DEBUGOUT "GRID'S RELATIVEROW == 0"
		thisform.Bindcontrols = .T.
		thisform.Draw && Flush the draw buffer
		DEBUGOUT "***** recoursource binding END ****"
	ENDPROC


ENDDEFINE
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform