>>for each oColumn in this.Columns >> with oColumn >> .DynamicBackColor = 'iif(inlist('+; >> str(.ColumnOrder)+',1,5,7) or type('+; >> .ControlSource+') = "C", rgb(255,255,0), rgb(0,255,255))' >> endwith >>endfor >>>
> .DynamicBackColor = 'iif(inlist('+; > str(.ColumnOrder)+',1,5,7) or type('+; > .ControlSource+') = "C",'+tran(rgb(255,255,0))+','+tran(rgb(0,255,255))+')' >>I'd also gladly omit the outer iif, and build two different strings instead, one for columns 1, 5 and 7, and another for the others. One less to recalculate for each cell.
* Assuming color determining method is in grid class >>for each oColumn in this.Columns >> oColumn.DynamicBackColor = '(this.SetColor("'+oColumn.Controlsource+'"))' >>endfor >>I've had this in the framework we use, and it was just too slow. Not visibly slow, though, but a real pain if you debugged. Any refresh would cause about forty calls to this method. On slower machines, you didn't even need the debugger to see this slow down.