Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change Row Color in a Grid????
Message
From
18/09/1998 13:30:13
Greg Mourad
National Right To Work Committee
Springfield, Virginia, United States
 
 
To
03/09/1998 06:56:30
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00132649
Message ID:
00138335
Views:
10
Each column in a grid has properties called DynamicBackcolor and DynamicForeColor.

To change the color of the active row, do the following:

1) Add a property to the grid called CurrentRecord

2) In the AfterRowColChange method of the grid, add the following code:
this.CurrentReocrd=recno()
this.Refresh

3) In each column's DynamicBackColor property, put the following:
"iif(recno()=this.parent.CurrentRecord,RGB(0,0,200),RGB(255,255,255) )"

4) In each column's DynamicForeColor property, put the following:
"iif(recno()=this.parent.CurrentRecord,RGB(255,255,255),RGB(0,0,0) )"

Note that the properties in DynamicBackColor and DynamicForeColor must me in quotes, or you'll get an error.
Previous
Reply
Map
View

Click here to load this message in the networking platform