>>>
>>>Of course, the best you can do is influence the process of creating the cursor in the first place, and add an integer column with actual color number. Then there's no iif, noarrays and no function at all, and you can use all the colors you like:
>>>>
'tran(myColorField)'
>>>>No iif() too :)
>>>Nothing at all :)
>>
>>OK, I was too quick. Not an integer column, but a character column with the tran() of the color number. Therefore:
>>
'myalias.myColorField'
>
>And I was too quick to say no iif() :) Made a pitfall and sensed for a moment ascan() was returning 0 or 1 :)
>Cetin
I actually tried it now (ok, should have tried before) - well, the field needs to be numeric (preferably integer), and it works just fine. I tried it on one of more complicated grids, which has regular textboxes in columns 1 and 3, and containers in 2, 4 and 5. The containers are populated with controls in form's init. The grid is based on a cursor which is created at form's .init, based on parameters passed, and then the recordsource for the grid is set, etc etc. It errors out when I assign the controlsource
ThisForm.evalgrd.Column3.Text1.controlsource='TMPEVALBTCH.FORMDESC'
with the error
Parent object will not allow this property setting for evaledit1.evalgrd.column3.text1.ControlSource.Error code is 0 (zero), there's no error checking in place, and the value of the controlsource is, accidentally, exactly what I want it to be (it was set automatically when I set the recordsource for the grid). The column doesn't have a controlsource.
I have really never seen this error. The colors, though, look really nice. I'm thinking of a rainbow grid, once I solve this one :)