Skip to Content
Sep 06, 2012 at 07:28 AM

add a ComboBox user field into a pane



I'm working on a code that add text user item in a pane of a form

I've no problem to do that

but when I try to do the same with a ComboBox user item it give me an error

with the follow code I add a text user item

oItem = form.Items.Add("tm_U_CSTH", SAPbouiCOM.BoFormItemTypes.it_EDIT);

sVal = oItem.UniqueID;

oItem.Left = 100;

oItem.Width = 70;

oItem.Top = 240;

oItem.Height = 16;

oItem.FromPane = 1;

oItem.ToPane = 1;

oEditText = ((SAPbouiCOM.EditText)(oItem.Specific));

oEditText.String = "";

oEditText.DataBind.SetBound(true, "OCLG", "U_CSTH");

for the combobox item I tried to change the last 3 rows

oCb = ((SAPbouiCOM.ComboBox)(oItem.Specific));

oCb.DataBind.SetBound(true, "OCLG", "U_FLDF");

but it doesn't work

can you help me? thanks