Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Different color row highlights for diff. criteria on a g
Message
From
05/08/2006 08:30:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/08/2006 08:02:20
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01143188
Message ID:
01143192
Views:
21
This message has been marked as the solution to the initial question of the thread.
>Hi, all,
>
>I'm trying to make my grid more visually absorbing by putting in different coloured row highlights for values answerable to different criteria.
>
>In the code below, I'm trying to highlight a row in purple if the value evaluates to more than 100, and to bright yellow, if it is below 60. For all other values, it should be green.The problem is that the final dynamicbackcolor always overpowers the previous dynamicbackcolor, enabling only any one statement.
>
>I've used a complicated IIF statement in the dynamicbackcolor, by merging a second IIF within one IIF in the init of the grid. However, it's not woking, although the first 2 statements work independently.
>
>The code is as follows:
>
>
>*both of the below are working...
>ogrd.SetAll("DynamicBackColor", "IIF(((pkg.nripe+pkg.ngreen)/(nmen+nwmn+nadl)>100),;
>RGB(128,0,255) , RGB(0,255,0))", "Column")
>
>ogrd.SetAll("DynamicBackColor", "IIF(((pkg.nripe+pkg.ngreen)/(nmen+nwmn+nadl)<50),;
>RGB(255,255,0) , RGB(0,255,0))", "Column")
>
>**I'm merging them both here...
>
>ogrd.SetAll("DynamicBackColor", "IIF(((pkg.nripe+pkg.ngreen)/(nmen+nwmn+nadl)>100),;
>RGB(128,0,255) , IIF{(pkg.nripe+pkg.ngreen)/(nmen+nwmn+nadl)}<50,;
>RGB(255,255,0)", "Column")
>
>
>
>
>Any help will be greatly appreciated
>
>Thanks!
>
>Steve

Steven,
If you need complex expressions then it's better to create a mthod that would return color and use that method instead. Anyway:
ogrd.SetAll("DynamicBackColor", ;
 "(IIF( ((pkg.nripe+pkg.ngreen)/(nmen+nwmn+nadl)>100),RGB(128,0,255) ,"+;
 " IIF( ((pkg.nripe+pkg.ngreen)/(nmen+nwmn+nadl)<50), RGB(255,255,0) , RGB(0,255,0))))")
PS: What's nmen,nwmn,nadl? Alias them.
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