Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic Color for Grid
Message
From
01/05/2002 08:56:11
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/05/2002 08:35:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00651265
Message ID:
00651270
Views:
17
>Can someone help me with this code. I want to display the text in a row as green if there is no priority and date is past due. The following code leaves all the rows black.
>
>foreexpr = 'IIF(ALLTRIM(myscLoc.priority) == "High",' + LTRIM(STR(RGB(255,0,0))) + ',IIF(ALLTRIM(myscLoc.priority) == "Medium",' + ;
> LTRIM(STR(RGB(0,0,255))) + ',IIF(myscLoc.dmdate) <' + DTOC(Date()) + ',' + LTRIM(STR(RGB(0,255,0))) + ',' + LTRIM(STR(RGB(0,0,0))) +')))'
>
> THIS.SETALL("DynamicForeColor",foreexpr,"Column")
foreexpr = 'IIF(ALLTRIM(myscLoc.priority) == "High",' + STR(RGB(255,0,0))+ ;
  ',IIF(ALLTRIM(myscLoc.priority) == "Medium",' + STR(RGB(0,0,255)) + ;
  ',IIF(myscLoc.dmdate < Date(),' + STR(RGB(0,255,0)) + ',' + STR(RGB(0,0,0)) +')))'

THIS.SETALL("DynamicForeColor",foreexpr,"Column")
However it would be easier if you do :
THIS.SETALL("DynamicForeColor","(thisform.GetStatus())","Column")

and in custom form method return color value based on your criteria.
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
Reply
Map
View

Click here to load this message in the networking platform