Skip to Content
0
Mar 05, 2015 at 11:00 AM

Get the selected item from a combo box

162 Views

Hi, everybody

I have created a grid in a folder.

One column of the grid is called TransferTo. I made this column into a column of combo boxes.

The combo box works well, but when I select an item, it does not go into the TransferTo field on the grid.

Please help me write the correct code.

How to bind?

Thanks

Leon Lai

--------------------

My relevant code is as below:

'==============================================

'//INSERT CHECKBOX IN COLUMN

'==============================================

oGrid.Columns.Item("TransferTo").Type = SAPbouiCOM.BoGridColumnType.gct_ComboBox

Dim oCombo As SAPbouiCOM.ComboBoxColumn

oCombo = oGrid.Columns.Item("TransferTo")

Dim oRecordSet As SAPbobsCOM.Recordset

Dim StrQuery As String

oRecordSet = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

StrQuery = "Select T0.CardCode,T0.CardName FROM OCRD T0 ORDER BY T0.CardCode "

oRecordSet.DoQuery(StrQuery)

oRecordSet.MoveFirst()

While Not oRecordSet.EoF

oCombo.ValidValues.Add(oRecordSet.Fields.Item("CardCode").Value.ToString, oRecordSet.Fields.Item("CardName").Value.ToString)

oRecordSet.MoveNext()

End While

Attachments

Capture.JPG (172.8 kB)