>I have a grid populated with a cursor, and based on the value of the column control I want to change the forecolor of the column. For instance, if the value in row1 column1 is a negative integer, I want to show it in red and if row2 column1 is positive, show it black. I've played around with the dynamicforecolor, but no success. I end up changing all rows red or black regardless of the values. Is what I'm trying to do posible?
>
>Thanks!
>
>John :)
John,
As long as you can have a logical expression you can set any indiviual cell, column, row or whole grid to any color. When you have a general expression use it with setall, otherwise set column dyn..color indiviually :
for ix = 1 to this.columncount
with this.columns(ix)
if type(.controlsource)$"NY"
.DynamicForeColor = "iif("+.controlsource+;
"<0,rgb(255,0,0),"+;
"iif("+.controlsource+;
">0,rgb(0,0,255),"+;
"rgb(0,0,0)))"
endif
endwith
endfor
It's easier than setall and you get desired result.
Cetin