>LOCAL lnMaxRows > >IF nKeyCode = 13 > WITH This.Parent.Parent > *** Calculate the maximum number of rows in the grid > lnMaxRows = INT( ( .Height - .HeaderHeight - ; > IIF( INLIST( .ScrollBars, 1, 3 ), SYSMETRIC( 8 ), 0 ) ) / .RowHeight ) > IF .RelativeRow >= lnMaxRows > *** This means we are on the last row in the visible portion of the grid > *** So we have to scroll the grid down one line > .DoScroll( 1 ) > ENDIF > .ActivateCell( .RelativeRow + 1, 1 ) > ENDWITH >ENDIF >