Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Row setting
Message
De
11/05/2001 07:44:53
 
 
À
10/05/2001 18:14:09
Todd Cottengim
Alpine Land Information Services
Redding, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00506039
Message ID:
00506146
Vues:
19
Hi Todd.

>> I would like to force the grid to locate the current record on the middle row of the grid or , if there are not enoght rows to fill the remaining rows of teh grid, place the current record further down to facilitate the filling of all rows. <<

This code, from "1001 Things You Wanted to Know About VFP" (Akins, Kramek, Schummer - Hentzenwerke Publishing) will do the trick for you:
LOCAL lnMaxRows
*** Display the last page of the grid when the form instantiates
IF DODEFAULT()
   Thisform.LockScreen = .T.
   WITH Thisform.GrdCustomer
     *** Calculate the maximum number of rows per grid page
     lnMaxRows = INT( ( .Height - .HeaderHeight - ;
     IIF( INLIST( .ScrollBars, 1, 3 ), SYSMETRIC( 8 ), 0 ) ) / .RowHeight )
     GO BOTTOM IN ( .RecordSource )
     *** Go to the record that should be in the first row of the last page
     SKIP -( lnMaxRows - 1 ) IN ( .RecordSource )
     .SetFocus()
     *** Make sure it is the first relative row
     DO WHILE .RelativeRow # 1
       .DoScroll( 1 )
    ENDDO
   ENDWITH
   Thisform.LockScreen = .F.
ENDIF 
Marcia
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform