CGridView:AddSheet


The AddSheet method adds a sheet to the grid and adds a tab to the tab area below the sheets. By default, a CGridView is created with only 1 sheet. After adding sheets, you can rename the sheets tabs using SetTab. This method updates the initial grid property defined by the value of GridParams.nSheets.

Syntax

CGridView:AddSheet()

CGridView:AddSheet(strLabel)

bullet.gif    Where strLabel is a label for the new tabbed sheet. if the label is not specified, it can be set using the SetTab method.

The grid below was created with 1 sheet, then a second sheet was added using AddSheet. Afterward, SetTab was used to assign the "old" and "new" names to names to the sheets:

Example

The following script adds a sheet to the CGridView object:

G = new_gridview()

-- attach a grid to the script

Printf("Sheets= %d\n", G:GetNumSheets())

-- Result: Sheets= 1

G:AddSheet()

-- add a sheet to the grid

Printf("Sheets= %d\n", G:GetNumSheets())

-- Result: Sheets= 2

Related Topics

CGridView class, SetNumCols, SetNumRows, GetNumSheets, SetTab


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