Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Movements in GRID
Message
De
09/01/2001 09:23:45
 
 
À
08/01/2001 23:33:40
Ashish Patel
Hindustan Petroleum
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00461008
Message ID:
00461099
Vues:
17
Hi Ashish.

>> I am using Visual Foxpro 6.0. In one of my form I am using grid. When user runs the form grid is populated with some records. user is not allowed to add a new row. Only last two columns are allowed to edit. What I want is when user is in last cell of a row after pressing ENTER he should directly go to the next row's cell. If it is possible, how can I check the curernt row and no. of rows in the grid ? <<

Create a custom textbox to drop in the appropriate grid column. This code goes in the text box's KeyPress:
IF nKeyCode = 13 OR nKeyCode = 9	&& Enter or Tab
	This.Move2NextRow()
	NODEFAULT
ENDIF	
Code in Move2NextRow() follows:
LOCAL lnMaxRows

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, .RelativeColumn )
ENDWITH
Marcia
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform