Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Color to grid/table browse based on value in a co
Message
From
18/05/2005 12:20:40
 
 
To
18/05/2005 09:21:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01015292
Message ID:
01015426
Views:
24
Cetin,

I took your advice one step further and created a *.prg in my application that does the coloring, so I can use this functionality from anywhere.

Thanks so much for your input! It worked great.


>>Just wondering... is there a way to "color" rows when I'm browsing a table with an index set to one of the field's value? For example, I might have the following records in a table:
>>
>>Name__________________Item
>>Laura Morgan....................basket
>>Laura Morgan....................perfume
>>Dave Jeffries......................tool set
>>Dave Jeffries......................tennis balls
>>Dave Jeffries......................golf club bag
>>Ann Crouch.......................picture frame
>>Pam Boyce.......................decorative soaps
>>Linda Hopper.....................paint set
>>Linda Hopper.....................table lamp
>>
>>I would want Laura's rows to be white, Dave's rows to be blue, Ann's row to be white, Pam's row to be blue, Linda's rows to be white, etc.
>>
>>Is this possible?
>>
>>Thanks,
>>
>>Alicia Bay for Joe Pawlowski
>
>
>SetAll('DynamicBackColor' ;
>"iif(myTable.Name = 'Laura Morgan', 0xFFFFFF, "+;
>"iif(myTable.Name = 'Dave Jeffries', 0xFF0000, "+;
>...)
>
>
>However you can see how complex it might get quickly. Instead you might create a method that'd return you the color. Then setall() looks like:
>
>
>SetAll('DynamicBackColor',"(thisform.GimmeColor(myTable.Name))")
>
>
>In GimmeColor you can check the name and return the color you want. Yet another easy way would be to have an array or cursor to supply colors. ie:
>
>select distinct name, 0xFFFFFF as Color from myTable into cursor myColors readwrite
>browse && fill the colors
>index on name tag name
>select myTable
>set relation to name into myColors
>SetAll('DynamicBackColor',"(myColors.Color)")
>
>Cetin
Previous
Reply
Map
View

Click here to load this message in the networking platform