topRow

Type: Integer

Availability: Read or write at run time

The topRow property contains the row that is displayed at the top edge of the non-fixed area of the current sheet of a Table control. This value may be decreased automatically by the control if lower values can still display the remainder of the rows.

The topRow property is set to the first non-fixed row in the following situations.

Changing the row or column property does not change the rows or columns that are displayed, as these are changed only by the leftColumn and topRow properties.

The following example shows the use of the topRow property.

convertPositionToRow(yPos: Real): Integer updating;
// Returns the table row whose top and height positions cover the
// y coordinate that is passed
vars
    iy          : Integer;
    totalHeight : Integer;
begin
    iy := theTable.topRow;
    totalHeight := theTable.rowHeight[1];    // the fixed row
    while iy <= theTable.rows do
        totalHeight := totalHeight + theTable.rowHeight[iy];
        if yPos <= totalHeight.Real then
            return(iy);
        endif;
        iy := iy + 1;
    endwhile;
    return(0);
end;