Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Want record to always be last row of grid
Message
De
11/11/2003 11:11:07
 
 
À
11/11/2003 09:19:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00848673
Message ID:
00848739
Vues:
16
Hello Hetty.

My questions is....How to I get the current record to always be on the 27th row whenever they move within the grid?

This code will position the the user on the last row of the grid when the form instantiates, also making sure that the page is filled if there are enough grid rows to fill the page. Hope it will get you started:
*** Display the last page of the grid when the form instantiates
IF DODEFAULT()
  WITH Thisform.MyGrid
    *** 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 )
    lnRecNo = RECNO( .RecordSource )
    *** Go to the record that should be in the first row of the last page
    IF lnMaxRows < RECCOUNT( .RecordSource )
      SKIP -( lnMaxRows - 1 ) IN ( .RecordSource )
    ELSE
      GO TOP IN ( .RecordSource )
    ENDIF	
    .SetFocus()
    IF .RelativeRow < 1
      *** Make sure it is the first relative row 
      DO WHILE .RelativeRow # 1
        .DoScroll( 0 )
      ENDDO	
    ELSE
      DO WHILE .RelativeRow # 1
        .DoScroll( 1 )
      ENDDO  
    ENDIF 
    *!* Now go back to the last record in the grid
    GO lnRecNo IN ( .RecordSource )
    .SetFocus() 
  ENDWITH
ENDIF	
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform