Skip to Content
Former Member
Feb 21, 2008 at 09:11 AM

Access the selected values from grid


I want to select vendor from the list.For this I have loaded vendor list in grid.How to get the value of selected vendor into variable ? For this I have used following code-

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

Dim dtgGrid As SAPbouiCOM.Grid

Dim strVendorCode As String

Dim strVendorName As String

Dim dtgRows As SAPbouiCOM.GridRows

Dim dtgColumns As SAPbouiCOM.GridColumns


If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK And pVal.Before_Action = True And pVal.ItemUID = "dtgGrid" Then

dtgGrid = SBO_Application.Forms.ActiveForm.Items.Item("dtgGrid").Specific


strVendorCode = dtgGrid.Rows.SelectedRows.Item(1, SAPbouiCOM.BoOrderType.ot_RowOrder)

strVendorName = dtgGrid.Rows.SelectedRows.Item(1, SAPbouiCOM.BoOrderType.ot_SelectionOrder)

End If

Catch ex As Exception


End Try

End Sub

But I could not get the value in the variable strVendorName .