cancel
Showing results for 
Search instead for 
Did you mean: 

Access the selected values from grid

Former Member
0 Kudos

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

Try

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

dtgGrid.Rows.SelectedRows.Add(pVal.Row)

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

SBO_Application.MessageBox(ex.Message)

End Try

End Sub

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

Accepted Solutions (1)

Accepted Solutions (1)

Nussi
Active Contributor
0 Kudos

Hi,

i would access value with the datatable

something like:

oForm = SBOApplication.Forms.Item(FormUID)

oGrid = oForm.Items.Item("grid").Specific

oGrid.DataTable.Columns.Item("insertthecolumnname").Cells.Item(i).Value

regards

David

Answers (0)