cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with combobox in matrix

Former Member
0 Kudos

Dear all

I have problem to get value selected in combo box when i add it in matrix.

I add with:

col = omatrix.Columns.Item(ID_COL_MAT)

col.ValidValues.Add(rs.Fields.Item(ID).Value(), rs.Fields.Item(VALUE).Value())

Can you help me?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

FOA
Advisor
Advisor
0 Kudos

Hi Antonio,

Here some code lines that are incluided inside the ItemEvent when the user selects the combo box.

If (pVal.ItemUID = "mat") And (pVal.ColUID = "ItemCode") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) Then

Dim oEdit As SAPbouiCOM.EditText

Dim oCombo As SAPbouiCOM.ComboBox

oCombo = colItemCode.Cells.Item(pVal.Row).Specific

oEdit = colItemName.Cells.Item(pVal.Row).Specific

oEdit.Value = oCombo.Selected.Description

End If

Hope this helps,

Felipe

Former Member
0 Kudos

Hi Felipe,

From your response, is it intentional that you used two different SAPbouiCOM Column objects?

oCombo = <b>colItemCode</b>.Cells.Item(pVal.Row).Specific

oEdit = <b>colItemName</b>.Cells.Item(pVal.Row).Specific

Regards,

Donna

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Donna,

What Felipe is doing is taking the value of the column colItemCode type ComboBox and copying it to the column colItemName that is of type EditText.

So, it is normal the two lines you are pointing use a different column name.

He is reading from the ComboBox by using

oCombo.Selected.Description

and writing its value into the EditText value

oEdit.Value

Hope it helps

Trinidad.

Former Member
0 Kudos

SAPbouiCOM.EditText oEdit;

SAPbouiCOM.ComboBox oCombo;

oCombo = (SAPbouiCOM.ComboBox)colItemCode.get_Cells().Item(new Integer(pVal.get_Row())).get_Specific();

oEdit = (SAPbouiCOM.EditText)colItemName.get_Cells().Item(new Integer(pVal.get_Row())).get_Specific();

oEdit.set_Value(oCombo.get_Selected().get_Description());

I got the following error message on the row "Item(new Integer...":

Row - Invalid index [66000-31]

Using debug I saw the value of pVal.getRow() is equal to 1 (int type), i'm on the first row of the matrix.

Can you help me to solve it ?

How can I get the value of combo box selected?

Thanks in advance

Best regards

Andrea

Answers (2)

Answers (2)

Former Member
0 Kudos

sorry

there is error : the last message is for another forum

Former Member
0 Kudos

Thank you