Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Problem
Message
De
11/02/2004 19:39:44
 
 
À
11/02/2004 01:01:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00876127
Message ID:
00876523
Vues:
28
This message has been marked as the solution to the initial question of the thread.
J'aime (1)
Hi Ryan.

HI, how to lock specific row,column in the grid to avoid editing records while im inserting new record under the same grid.

if I correcly understand what you are trying to do, what you want to do is add a custom template method called "ValidateCurrentRow" to your grid class. The validation code in this method goes in the instance. Add the following code ( This code requires version 7 or later to run) to BeforeRowColChange:
LPARAMETERS nColIndex
WITH This
  IF INLIST( .RowColChange, 1, 3 )
    *** If we are trying to move to a new row
    *** validate the current row
    IF NOT EOF( .RecordSource ) AND RECCOUNT( .RecordSource ) > RECNO( .RecordSource )  
      *** Do not allow the move if the validation fails
      IF .ValidateCurrentRow()
        *** peachy keen go ahead and move off the row
        *** and make sure the highlight gets reset
      ELSE
        NODEFAULT
      ENDIF	
    ENDIF
  ENDIF
ENDWITH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform