Usually you set the DynamicForeColor and DynamicBackColor in grid's Init. Try to make the expression optimizable (e.g. myTable.Field = padred expression)
I don't think you can speed up these expressions much - that's the price you pay for using Dynamic colors.
>I have been using the below code for some time but it seems it is quite slow, what is a way to just change the grid colors for the row the user changes, rather than have this code run on the entire grid with every row change.
>
>
>
>Thisform.Grid1.SetAll("DynamicForeColor",;
>"IIF((<Var> == ALLTRIM(<tablename>.<fieldname>) AND <boolean1 field>) OR ;
> (<Var> == ALLTRIM(<tablename>.<fieldname>) AND <boolean2 field>), RGB(128,64,64), RGB(255,255,255))",;
>"Column")
>
>Thisform.Grid1.SetAll("DynamicBackColor",;
>"IIF((<Var> == ALLTRIM(<tablename>.<fieldname>) AND <boolean1 field>) OR ;
> (<Var> == ALLTRIM(<tablename>.<fieldname>) AND <boolean2 field>), RGB(128,64,64), RGB(255,255,255))",;
>"Column")
>
>
>
>Should I put the color code on AfterRowColumnChange?
If it's not broken, fix it until it is.
My Blog