Will,
Let your baseclass code run with a dummy controlsource first (ie: prod_type), then change its properties.
dodefault()
for each oColumn in this.Columns
if upper(oColumn.ControlSource) = this.Recordsource+'.PROD_TYPE'
oColumn.Header1.Caption = 'Product Type'
oColumn.Text1.Controlsource = '(iif(...))'
exit
endwith
endfor
oColumn.Addobject('myCombo','Combobox')
with oColumn.myCombo
.Additem('Intl')
.Additem('Def')
endwith
oColumn.Currentcontrol = 'myCombo'
oColumn.sparse = .f.
Fox2x style format still exists with 'M' format property but I don't think it would be suitable.
Cetin
>Hi Marcia/Cetin,
>
>Yes prod_type is a field in the table
>Setting the columns controlsource works - only problem is that my grid baseclass looks to the columns controlsource to get the column heading from my data dictionary. :(
>
>Is there any other way of doing something like this.. the field is readonly so I don't want to use a Combo, but this is basically the effect I want.. a combo with a column bound to a data source.
>
>the old 2.x spinner format (where you give it a list of items and you can press space to cycle through them) does that still exist and would it be suitable?
>
>Last resort.. I could create another column with the text data I want to display.
>
>Any suggestions?
>
>TIA
>
>W(no h!)ill
>
>>Hi Whil.
>>
>>>>the browse command was as follows
>>
>>disp_type = IIF(prod_type=1, "Intl", IIF(prod_type=2,"Ded",""))
>>
>>
>>nothing special.. but how do I do the same thing in a grid's textbox? <<
>>
>>Put this in the controlSource for the
column:
>>
>>( IIF(prod_type=1, "Intl", IIF(prod_type=2,"Ded","")) )
>>
>>I am assuming that prod_type is a field in the table you are using for the grid's RecordSource.
>>
>>Marcia