Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validating Data In A Grid Problem.
Message
 
 
À
05/02/2002 11:32:01
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00615529
Message ID:
00615539
Vues:
29
Code from my grid class that detects when the row changes:
DEFINE CLASS gridcontrol AS grid

   *-- used to determine if the active grid row has changed 
   *-- in the Before and AfterRowColChange methods
   oldactiverow = 1

   Name = "gridcontrol"

   PROCEDURE Init
      if !empty(This.RecordSource) and reccount(This.RecordSource) <> 0
         This.OldActiveRow = RecNo()
      else
         This.OldActiveRow = 0
      endif
   ENDPROC
   PROCEDURE BeforeRowColChange
      LPARAMETERS nColIndex
      if !empty(This.RecordSource) and reccount(This.RecordSource) <> 0
         This.OldActiveRow = RecNo(This.RecordSource)
      else
         This.OldActiveRow = 0
      endif
   ENDPROC
   PROCEDURE AfterRowColChange
      LPARAMETERS nColIndex
      if !empty(This.RecordSource) and reccount(This.RecordSource) <> 0
         if This.OldActiveRow <> RecNo(This.RecordSource)
            This.GridRowChange()
            ThisForm.Refresh()
         endif
      endif
   ENDPROC
   *-- method to place additional code to be called by
   *-- AfterRowColChange only if the Row changed
   PROCEDURE gridrowchange
       *-- put your row change code here

   ENDPROC
ENDDEFINE
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform