📚 SAP Business One SDK Help

Grid Object
See Also  Members  Example

Description

Represents a grid, which displays data in a table.

Object Model








Remarks

All rows in the grid are 0-based.

Example

Adding a grid (Visual Basic)Copy Code
' Add a Grid item to the form
oItem = oForm.Items.Add("MyGrid", SAPbouiCOM.BoFormItemTypes.it_GRID)

' Set the grid dimentions and position
oItem.Left = 20
oItem.Top = 60
oItem.Width = 430
oItem.Height = 200

' Set the grid data
oGrid = oItem.Specific

oForm.DataSources.DataTables.Add("MyDataTable")
oForm.DataSources.DataTables.Item(0).ExecuteQuery("select CardCode, CardName, DocDate, DocNum, DocTotal, DocStatus from OINV")
oGrid.DataTable = oForm.DataSources.DataTables.Item("MyDataTable")

' Set columns size
oGrid.Columns.Item(0).Width = 50
oGrid.Columns.Item(1).Width = 60
oGrid.Columns.Item(2).Width = 130






See Also