>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