CGrid:GetNumCols
The GetNumCols method returns the number of columns in the current grid sheet. The number of columns may differ between sheets.
nCols = G:GetNumCols()
where
nCols is the number of columns in the grid. On failure, 0 is returned.
The following script creates a grid and increases the number of columns at a later time:
|
-- new grid with 3 cols, 10 rows, 1 Sheet |
|
-- result: cols = 3 |
|
-- Select Sheet 3 (out of range) |
|
-- result: cols = 0 (sheet out of range) |
|
-- change to 8 columns |
|
-- result: cols = 8 |