>Hello All...
>
>I was playing around with the DynamicBackColor property in a Grid and have managed to get the columns to alternate colors between rows depending on the RECNO(). Is there a way, and what would the syntax be for updating the color of a row based on values in each record. I would also like to assign a new color to a row if any of the text boxes in that row are clicked by the user. Any input would be helpful. Thanks in advance.
>
>Baron Morvant
Baron,
Just like recno() expression. ie: If you want to set all row to blue if myField value is 'Baron' then your expression would be like :
this.Setall('DynamicBackcolor', ;
'iif(myAlias.myField="Baron",rgb(0,0,255),rgb(255,255,255))')
If your expression gets a bit complex then use a method instead (it's easy to write complex expressions wrong and Dynamic* wouldn't error). ie:
for each oCol in this.Columns
oCol.DynamicBackcolor = "(thisform.GetMeColor('"+oCol.Controlsource+"'))"
endfor
lparameters tcControlSource
do case
case lower(tcControlsource) == 'somealias.somefield' ;
and eval(tcControlsource) = 'SomeValue'
return 0xFFFF00
case Soemthing
....
otherwise
return 0xFFFFFF
endcase
Cetin