cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Business One :: Get the value in current row in the gridview

0 Kudos
1,315

Dear All Experts/Gurus,

Can you please give me an example of retrieving the data of current row in my datagridview from visual studio. my current data relies on SBO

Good Day!

View Entire Topic
former_member211473
Contributor

Hi

If you do have sdk knowledge you can try out the given code

SAPbouiCOM.DataTable dtt = null;

private SAPbouiCOM.Grid Grid0;

        private void SBO_Application_ItemEvent_showdata(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;


            if (((pVal.ItemUID == "Item_0") & (pVal.EventType == SAPbouiCOM.BoEventTypes.et_DOUBLE_CLICK) & (pVal.Before_Acti            on == false)))
            {
                try
                {
                    int index = Grid0.GetDataTableRowIndex(pVal.Row);
                    p = Convert.ToString(dtt.Columns.Item("column name").Cells.Item(index).Value);
                    Application.SBO_Application.MessageBox(Convert.ToString(p));               
                }
                catch (Exception e)
                {
                }
                //var p = dtt.Columns.Item(pVal.ColUID).Cells.Item(1).Value;
                //Application.SBO_Application.MessageBox(Convert.ToString(p));
            }


           if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_CLOSE)
           {
              Application.SBO_Application.ItemEvent -= new SAPbouiCOM._IApplicationEvents_ItemEventEventHandler(SBO_Applicati              on_ItemEvent_showdata);
           }
       }


0 Kudos

hi sir, i'm trying to integrate sap business one to visual studio, where i'm using DI API to load and to modify the data if needed, i would like to ask one more thing if it's possible to refresh the active form in SBO if there's a changes performed in Visual Studio?

former_member211473
Contributor
0 Kudos

Hi

can you just explain your need with an example ?

Thanks