CGridView:FindCol
The FindCol method returns the column number containing the specified string. By default, the search is performed in the first top heading row at index 0. You can also search another top heading at row index -1, -2, etc., or the grid body starting at row 1.
nColumn = CGridView:FindCol( strName )
nColumn = CGridView:FindCol( strName, nRow )
Where strName is the string to locate.
Optionally, nRow specifies a different row to search. If this is omitted, only row 0 is searched.
nColumn is returned as the index of the column found. On error, -10 is returned, as it is unlikely a grid has more than 10 side columns.
The following script attaches a grid window and finds a named column:
|
-- attaches the top-most grid window from Mira |
|
-- returns the column with top heading "x center". |
CGridView class, GetCol, GetStr, FindRow
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.