Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DynamicForeColor property
Message
From
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:
00095876
Views:
25
>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
Ç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