>Hi, all,
>
>I'm trying to make my grid more visually absorbing by putting in different coloured row highlights for values answerable to different criteria.
>
>In the code below, I'm trying to highlight a row in purple if the value evaluates to more than 100, and to bright yellow, if it is below 60. For all other values, it should be green.The problem is that the final dynamicbackcolor always overpowers the previous dynamicbackcolor, enabling only any one statement.
>
>I've used a complicated IIF statement in the dynamicbackcolor, by merging a second IIF within one IIF in the init of the grid. However, it's not woking, although the first 2 statements work independently.
>
>The code is as follows:
>
>
>*both of the below are working...
>ogrd.SetAll("DynamicBackColor", "IIF(((pkg.nripe+pkg.ngreen)/(nmen+nwmn+nadl)>100),;
>RGB(128,0,255) , RGB(0,255,0))", "Column")
>
>ogrd.SetAll("DynamicBackColor", "IIF(((pkg.nripe+pkg.ngreen)/(nmen+nwmn+nadl)<50),;
>RGB(255,255,0) , RGB(0,255,0))", "Column")
>
>**I'm merging them both here...
>
>ogrd.SetAll("DynamicBackColor", "IIF(((pkg.nripe+pkg.ngreen)/(nmen+nwmn+nadl)>100),;
>RGB(128,0,255) , IIF{(pkg.nripe+pkg.ngreen)/(nmen+nwmn+nadl)}<50,;
>RGB(255,255,0)", "Column")
>
>
>
>
>Any help will be greatly appreciated
>
>Thanks!
>
>Steve
Steven,
If you need complex expressions then it's better to create a mthod that would return color and use that method instead. Anyway:
ogrd.SetAll("DynamicBackColor", ;
"(IIF( ((pkg.nripe+pkg.ngreen)/(nmen+nwmn+nadl)>100),RGB(128,0,255) ,"+;
" IIF( ((pkg.nripe+pkg.ngreen)/(nmen+nwmn+nadl)<50), RGB(255,255,0) , RGB(0,255,0))))")
PS: What's nmen,nwmn,nadl? Alias them.
Cetin