Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlight entire row on grid
Message
From
07/01/2003 02:44:38
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
 
 
To
06/01/2003 12:44:11
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00738413
Message ID:
00738665
Views:
21
>I'd like to have a grid color an entire row say black on yellow that follows the recordmark on the grid. My client is used to a Foxpro/DOS app that worked this way. Ive tried some things with DynamicBack/ForeColor, but I don't know how to have it follow the RecorkMark.
>
>Any help would be appreciated,
>
>Larry Morelli


I use this simple code for grid row highlighting :
procedure grid_highlight_prep
parameters  toGridRef,tnSelForeColor,tnSelBackColor,tcPreservedColumns
*parameters :	toGridRef 		- grid reference
*		tnSelForeColor		- foreground color for highlighted row 
*		tnSelBackColor		- background color for highlighted row
*		tcPreservedColumns	- columns with preserved default settings 
local lnForeColor,lnBackColor,i
toGridRef.addproperty('GridRecno',0)
lnForeColor = toGridRef.ForeColor
lnBackColor = toGridRef.BackColor
tcPreservedColumns = IIF(VARTYPE(tcPreservedColumns)#'C','',tcPreservedColumns)
FOR i=1 TO toGridRef.ColumnCount
	IF !toGridRef.Columns(i).name $ tcPreservedColumns
		toGridRef.Columns(i).DynamicBackColor = ;
			"iif(this.GridRecno = RECNO(),"+alltrim(str(tnSelBackColor))+","+alltrim(str(lnBackColor))+")"
		toGridRef.Columns(i).DynamicForeColor = ;
			"iif(this.GridRecno = RECNO(),"+alltrim(str(tnSelforeColor))+","+alltrim(str(lnForeColor))+")"
	ENDIF
ENDFOR
RETURN

PROCEDURE grid_highlight
PARAMETERS toGridRef
IF RECNO()# toGridRef.GridRecno
	toGridRef.GridRecno =  RECNO()
	toGridRef.VISIBLE = .T.
ENDIF
Example:
Grid Init method
grid_highlight_prep(this,rgb(0,0,0),rgb(187,233,255),'')
grid_highlight(this)
Grid AfterRowColChange method
LPARAMETERS nColIndex
grid_highlight(this)
Previous
Reply
Map
View

Click here to load this message in the networking platform