Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlighting Grid Rows
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01398121
Message ID:
01398126
Views:
67
Try

This.SetAll("DynamicBackColor","ICASE(Quan_ship = 0, RGB(255,128,255),....,RGB(255,255,255))", "Column")

in the grid refresh




>Hi Gang!
>
>I am modifying an ORDER Program for ordering inventory items. I was wanting to add highlighting to a Grid to show which rows met certain conditions.
>
>I wanted to highlight in RED any item (ROW) that did not receive any of an ordered item.
>I wanted to highlight in YELLOW any item that received less than the ordered amount.
>I wanted to highligt in WHITE any item that received the correct amount ordered.
>And finally I wanted to highlight in BLUE any item that received more than the amount ordered.
>
>This is to make visually easier to see problem items in the order.
>
>Here is the code I used in the FORM's INIT.
>
>
>*TMT 05/05/09 Set up a dynmaic backcolor for the grid.
>*Red - Did not receive ANY of that item.
>*Yellow - Received SOME of the item, but less than what was ordered.
>*White - Received ALL of that item.
>*Blue - Received MORE than what was ordered for the item.
>lcForeColor = 'IIF(reorder.Quan_ship = 0, RGB(255,255,255), ;
>		IIF(reorder.Quan_ship < reorder.Quan_Onord, RGB(255,255,255), ;
>		IIF(reorder.Quan_ship = reorder.Quan_Onord, RGB(0,0,0), ;
>		IIF(reorder.Quan_ship > reorder.Quan_Onord, RGB(255,255,255), RGB(0,0,0))))'
>
>lcBackColor = 'IIF(reorder.Quan_ship = 0, RGB(255,128,255), ;
>		IIF(reorder.Quan_ship < reorder.Quan_Onord, RGB(255,255,128), ;
>		IIF(reorder.Quan_ship = reorder.Quan_Onord, RGB(255,255,255), ;
>		IIF(reorder.Quan_ship > reorder.Quan_Onord, RGB(0,255,255), RGB(255,255,255))))'
>
>Thisform.grddetail.SetAll('DynamicForeColor',lcForeColor,'COLUMN')
>Thisform.grddetail.SetAll('DynamicBackColor',lcBackColor,'COLUMN')
>Thisform.grddetail.Refresh	
>
>
>The table is named REORDER and the fields are QUAN_SHIP (quantity shipped to me), QUAN_ONORD (Quantity ordered from the supplier).
>
>I do get lots of records in the order, but the grid stays WHITE, even when I get back items in the order that are 0 for Quan_ship, and some are LESS than the Quantity Ordered.
>
>Am I totally messed up here?
>
>Thanks a bunch!
'If the people lead, the leaders will follow'
'War does not determine who is RIGHT, just who is LEFT'
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform