CGrid:SH_FindRow
The SH_FindRow method returns the row number containing the specified string. By default, the search is performed in the first left heading column at index 0. You can also search another side heading at a column index below 0, namely, -1, -2, etc., or the grid body starting at column 1.
Note: The side heading column numbering differs with the CGridView class. Going leftward from the grid, the CGrid side headings are numbered 1, 2, 3, ..., whereas the CGridView side headings are numbered 0, -1, -2, ...
nRow = CGrid:SH_FindRow( strName )
nRow = CGrid:SH_FindRow( strName, nColumn )
Where strName is the string to locate.
Optionally, nRow specifies a different column to search. If this is omitted, only column 0 is searched.
nRow is returned as the index of the row found, starting with 1. On error, -10 is returned, as it is unlikely a grid has more than 10 top rows.
The following creates a CGrid, fills it with data, then finds a named column:
|
-- create a new CGrid object |
-- fill the grid |
|
|
-- returns the row with contents "x center". |
CGrid class, Get, TH_FindCol, FindCell
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.