Skip to Content
0
Former Member
Nov 16, 2012 at 03:37 PM

How to add column to grid

131 Views

Hi

I have created Grid like this . Through query i have only 2 fields . I want 1 more column to Grid , how it can be done.

oItem = oForm.Items.Item("15")

oNewItem = oForm.Items.Add("MyGrid", SAPbouiCOM.BoFormItemTypes.it_GRID)

oNewItem.FromPane = 8

oNewItem.ToPane = 8

oNewItem.Left = oItem.Left + 125

oNewItem.Top = oItem.Top

oNewItem.Width = 275

oNewItem.Height = 175

oGrid = oNewItem.Specific

Try

oForm.DataSources.DataTables.Add("MyDataTable")

Catch

End Try

oForm.DataSources.DataTables.Item(0).ExecuteQuery("SELECT a.Code, a.Name FROM [@Temp]a")

oGrid.DataTable = oForm.DataSources.DataTables.Item("MyDataTable")

Thanks