Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validating Data In A Grid Problem.
Message
 
 
To
05/02/2002 11:32:01
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00615529
Message ID:
00615539
Views:
28
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform