>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).
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