I presume you want to know the number of the current
displayed row and the number of rows displayed in the grid at any one time.
The number of the displayed row is easy. The
RelativeRow grid property returns the relative position of the active row in the grid display. If the active row is the top displayed row, the RelativeRow will be 1. If it is the third row from the top, the RelativeRow will be 3.
Getting the number of displayed rows is less straightforward. You will have to figure it out using something like the following process:
WITH oGrid
nDisplayedRows = ROUND(( .Height - .HeaderHeight ) / .RowHeight, 0 )
ENDWITH
or, if you want to include only full rows,
excluding any displayed partial row at the bottom of the grid,
WITH oGrid
nDisplayedRows = INT( (( .Height - .HeaderHeight ) / .RowHeight )
ENDWITH
or, if you want to
include any partial row at the bottom of the grid in your count,
WITH oGrid
lnNetHeight = .Height - .HeaderHeight
nDisplayedRows = INT( (( lnNetHeight ) / .RowHeight ) + ;
IIF( MOD( lnNegHeight, .RowHeight ) > 0, 1, 0 )
ENDWITH
Regards,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.comNo trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.