CGridView:GetMaxCol


The GetMaxCol method returns the 1-based index of the maximum grid column containing data. For example, suppose a CGridView is created with 20 columns, but the last non-empty column containing data is column 12. In this example, the method returns 12.

Syntax

nMaxCol = CGridView:GetMaxCol()

bullet.gif    Where nMaxCol is the index of the highest column containing data.

bullet.gif    On failure, 0 is returned.

Example

The following script returns the index of the last non-empty column containing data:

G = attach_gridview()

-- attach a grid on the Mira desktop

nMaxCol = G:GetMaxCol()

-- return the 1-based index of the last column

Related Topics

CGridView class, GetMaxRow, GetNumCols, SetNumCols, ToTable


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