cancel
Showing results for 
Search instead for 
Did you mean: 

add a ComboBox user field into a pane

former_member258877
Participant
0 Kudos

Hi

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member258877
Participant
0 Kudos

I've found the solution!

Answers (1)

Answers (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

You also have to change your code as follows:

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

Now do what you want to do.

You also set this for adding the ComboBox.

Hope it Helps

Thanks