Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cells in a Grid
Message
From
14/10/1997 13:10:47
Randy Johnson
Canadian Broadcasting Corporation
Winnipeg, Manitoba, Canada
 
 
To
11/10/1997 19:02:44
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00054143
Message ID:
00054484
Views:
33
THanks Paul,

Combined with the .Column() it works just fine ...

oGrd.Columns(2).dynamicbackcolor = "IIF(!empty(template.mobile), RGB(0,128,255),RGB(255,255,255))"
oGrd.Columns(3).dynamicbackcolor = "IIF(!empty(template.remote), RGB(0,128,255),RGB(255,255,255))"
oGrd.Columns(4).dynamicbackcolor = "IIF(!empty(template.studio11), RGB(0,128,255),RGB(255,255,255))"
oGrd.Columns(5).dynamicbackcolor = "IIF(!empty(template.studio14), RGB(0,128,255),RGB(255,255,255))"
oGrd.Columns(6).dynamicbackcolor = "IIF(!empty(template.studio16), RGB(0,128,255),RGB(255,255,255))"
oGrd.Columns(7).dynamicbackcolor = "IIF(!empty(template.studio20), RGB(0,128,255),RGB(255,255,255))"
oGrd.Columns(8).dynamicbackcolor = "IIF(!empty(template.studio22), RGB(0,128,255),RGB(255,255,255))"
oGrd.Columns(9).dynamicbackcolor = "IIF(!empty(template.studio51), RGB(0,128,255),RGB(255,255,255))"
oGrd.Columns(10).dynamicbackcolor = "IIF(!empty(template.stud_11e), RGB(0,128,255),RGB(255,255,255))"



>I don't know what properties are you using, but column's DynamicBackColor and DynamicForeColor properties are exactly what you need to use and they work for all cells in the column. Of course, you must set these properties for all columns.
>
>Try this in the DynamicBackColor property for one column:
>
>iif(mod(recno(), 2) = 0, rgb(255,0,0), rgb(0,0,255))
>
>It must set the the back color to red for even records and to blue for odd records.
>
>I remember that last week somebody said that this didn't work for him. Finally he rebuilt the whole grid and everything was fine. I can't confirm that. Maybe there's a bug related to this and I'm not aware of. Try it with a new grid and see what's the difference vs. your actual grid.
>
>Vlad
>
>>Those properties work fine for the cell that has focus, but does not seem to work
>>for the entire grid. This is what I am Trying to do ... The grid is read only and has
>>a fixed x and y count.
>>
>> COL1 COL2 COL3 ...
>>cell1 red wht wht
>>cell2 red wht red
>>cell3 red wht red
>>cell4 wht wht wht
>>cell5 wht wht wht
>>...
>>
>>The Background color has to be set based on whether the cell is empty or not ..
>>
>>Randy
>>>Use DynamicBackColor and DynamicForeColor properties. There's also a good example in the help on how to use them.
>>>
>>>Vlad
>>>
>>>>Does anyone know how to control forground and background colors on a range
>>>>of cells in individual columns of a grid at display time ?? The SetAll method kind of
>>>>works but it seems to apply to all columns in the grid. (ie. I want to be able to
>>>>change the color of a cell if it is not empty at display time)
Previous
Reply
Map
View

Click here to load this message in the networking platform