CGrid:SetNumCols


The SetNumCols method specifies the number of columns in the current grid sheet. The number of columns may differ between sheets.

Syntax

G:SetNumCols( nCols )

where

    nCols is the number of columns to set in the grid.

Example

The following script creates a grid and increases the number of columns at a later time:

G = NewGrid(3,10)

-- new grid with 3 cols, 10 rows, 1 Sheet

Printf("cols = %d\n", G:GetNumCols() )

-- result: cols = 3

G:SelectSheet( 3 )

-- Select Sheet 3 (out of range)

Printf("cols = %d\n", G:GetNumCols() )

-- result: cols = 0 (sheet out of range)

G:SetNumCols( 8 )

-- change to 8 columns

Printf("cols = %d\n", G:GetNumCols() )

-- result: cols = 8

Related Topics

SetNumRows

GetNumCols

SetDim

CGrid class