CGridView:FromTable


The FromTable method copies the contents of a 2-dimensional table to the grid. Each index of the table contains a row of data which is itself a table of data to save in the columns.

Syntax

CGridView:FromTable( table )

bullet.gif    table is a 2-dimensional table containing the cell values, organized in row order.

Example

The following script returns the entire grid contents as a 1-dimensional array with values that are numbers.:

G = new_gridview("My Grid")

-- create CGridView with default properties

tbl = {}

-- create a 1-dimensional array with values that are numbers.

tbl[1] = { -4.658, 6, 10 }

-- create a 1-dimensional array with values that are numbers. of 3 columns for row 1

tbl[2] = { 17, 18, 25.7 }

-- create a 1-dimensional array with values that are numbers. of 3 columns for row 2

tbl[3] = { -6, -2, 3.5 }

-- create a 1-dimensional array with values that are numbers. of 3 columns for row 3

G:FromTable(tbl)

-- Set the grid to the contents of the table

Related Topics

CGridView class, ToTable, SetRect


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.