Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlighting Grid Rows
Message
From
06/05/2009 10:54:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
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:
01398153
Views:
55
>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!

Tommy,
Dynamic* need valid expressions. When the expression is not valid an error is not displayed but silently the colring is not applied as well. You are missing closing parentheses in both expressions.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform