CGrid:SetTH_Titles


The SetTH_Titles method sets the titles for a top heading row. The titles are taken from a 1-dimensional table, and the number of table elements determines how many columns of the top heading are set. If there is more than one top heading row, the specific row must also be specified. The default (first) top heading row is in top heading row 1. Going upward from the grid, the second top heading is in row 2, and so on.

Note: The top heading row numbering differs with the CGridView class. Going upward from the grid, the CGrid top headings are numbered 1, 2, 3, ..., whereas the CGridView top headings are numbered 0, -1, -2, ...

Syntax

CGrid:SetTH_Titles( tblTitles )

CGrid:SetTH_Titles( tblTitles, nTopRow )

bullet.gif    tblTitles is a 1-dimensional table containing titles for the top heading row.

bullet.gif    nTopRow is the optional top heading row number to set. If omitted, the first top heading row is set.

Example

The following script sets the titles for the first 4 (or all 4) columns of the default top heading in the first top row:

G = new_grid()

-- create a new CGrid object

-- assemble the grid

 

tblTitles = { "A", "B", "C", "D" }

 

G:SetTH_Titles( tblTitles )

-- set titles in the default top heading row

The next script sets the titles for the first 4 (or all 4) rows of the second top row. The first top row would need to be set in addition to row 2:

G = new_grid()

-- create a new CGrid object

-- assemble the grid

 

tblTitles = { "A", "B", "C", "D" }

 

G:SetTH_Titles( tblTitles, 2 )

-- set titles for top row 2

Related Topics

CGrid class, SetSH_Titles, SetTH_Title


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