Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DynamicForeColor property
Message
From
30/04/1998 23:43:20
 
 
To
30/04/1998 03:07:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00095870
Message ID:
00096205
Views:
17
Cetin & Jess,

Further to my previous reply... I discovered that the erratic behaviour in the cell colouring came from using the grid.Column.Text.Value. It would apply the colour to the cell previously active; in a page up/down, whole columns got the colour based on the current cell's value.
Referencing the table's field value instead fixed the problem, however, both ways should have worked.

Thanks, Ashley

>>I'm trying to set the cells in a grid to different colours based on their value.
>>So far I'm getting erratic results where (apparently) random cells are changing color when scrolling a line or cell at a time, sometimes effecting the whole column or neighbouring cells. I've tried refreshing the grid with no effect.
>>I've tried the odd/even record example and that works fine, it just does not seem to to work properly at the grid.column.text.value level.
>>
>>Any suggestions?
>>
>>TIA
>Ashley,
>Dynamicback or forecolor also work with value level but setting the correct expression is sometimes tricky. Try the following example that changes backcolor in a buffered table based on value change (edited fields and newly appended recs have red backcolor).
*Grid.init
>for ix = 1 to this.columncount
>    with this.columns(ix)
>      cField = substr(.controlsource,rat(".",.controlsource)+1)
>      .DynamicBackColor = "iif(oldval(["+cField+"])#"+cField+" or recno()<0,"+;
>			str(rgb(255,0,0))+","+str(this.backcolor)+")"
>    endwith
>endfor
>Cetin
Previous
Reply
Map
View

Click here to load this message in the networking platform