Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid dynamic cell color
Message
From
30/07/1999 09:10:51
George Simon
GS Data Technologies, LLC
Cincinnati, Ohio, United States
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00248110
Message ID:
00248156
Views:
17
Hi Al,

In the Init() event of your grid, try something like this :

DODEFAULT()
LOCAL lcColorString

* --------------------------------------------
* Color assignments:
* quantity = 0 or EMPTY() : WHITE
* quantity < instock : GREEN
* quantity = instock : YELLOW
* quantity > instock : RED
* --------------------------------------------
lcColorString = "IIF( EMPTY(v_OrderItems.quantity), RGB(255,255,255), " + ;
"IIF( v_OrderItems.quantity < v_OrderItems.instock, RGB(0,255,0)," + ;
"IIF( v_OrderItems.quantity = v_OrderItems.instock, RGB(255,255,0), RGB(255,0,0))))"

* --------------------------------------------
* Lets assume column4 is the quantity column.
* --------------------------------------------
this.Column4.DynamicBackColor = lcColorString


The trick is how to get the instock value since you do not know the part number to look at until the user enters it. Let's assume you have a part number field called 'partnum'. In the Valid() method of the partnum field you need something that does the following:

REPLACE v_OrderItems.instock WITH GetInStockValue( v_OrderItems.partnum )

..where GetInStockValue() returns the instock value from an inventory table.

HTH

George
George Simon, MCP
Previous
Reply
Map
View

Click here to load this message in the networking platform