Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding color to one section of a grid

Status
Not open for further replies.

amwprogg

Programmer
Jul 8, 2005
52
GB
Hi all.
I have a grid and one of the columns of the grid is a number (a running total) - and I want to add color to the grid - if the total is zero to 3 I want the cell to be green - if 4-5 I want it to be amber (orange) - above 5 red.
Like traffic lights really.
Based on the value of the total, how can I color one cell of my grid?
Andy.
 
Using the dynamicbackcolor property. Consult the VFP help file that shows an example, and extrapolate from there.
 
Just a small point...

If you use a dynamic property in a grid, you can get some pretty confusing slowdowns during debugging.

To avoid this, add a property to the form to conditionally add the dynamic property.

i.e. (In the grid's init method)

if !thisform.bDebugging
this.dynamicforecolor = ...
endif

Darrell
 
Thanks all for your valuable contributions. I think I'll be able to sort out my problem now.
Andy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top