Skip to Content
author's profile photo Former Member
Former Member

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

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 .

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Feb 21, 2008 at 09:33 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.