BOOL GetRowArray(ROWCOL nRowCount, CRowColArray& awTop, CRowColArray& awBottom, BOOL bFixed = FALSE);
nRolCount
You should pass the row count in the grid.
awTop
Reference to an array of ROWCOL attributes to store the first row of a range of rows.
awBottom
Reference to an array of ROWCOL attributes to store the last row of a range of rows.
bFixed
TRUE if only completely selected rows shall be returned; FALSE if rows shall also be returned in which only some cells have been selected.
TRUE if the method could return any rows; FALSE if not.
This method loops through each range in the list and returns an array of rows. If there are intersections, ranges will be combined. The array is sorted by value.
The method stores ranges of rows in awTop and awBottom, where awTop[n] contains the first row and awBottom[n] contains the last row of the range at position n.
This example shows you how you can determine selected rows and loop through them:
CRangeList rangeList;
CRowColArray awTop, awBottom;
if (rangeList.GetRowArray(GetRowCount(), awTop, awBottom))
{
for (ROWCOL n = 0; n < awTop.GetCoun( ); n++)
{
TRACE("Row %ld to %ld is selected\n", awTop[n], awBottom[n]);
}
}
Class Overview | Class Members