Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid BeforeRowColChange
Message
From
26/11/1999 14:22:49
Rex Mahel
Realm Software, Llc
Ohio, United States
 
 
To
26/11/1999 13:37:37
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00295681
Message ID:
00295811
Views:
27
Marcia,

What if the record does not pass validation? How do I prevent the record pointer from moving from the AfterRowColChange method?

TIA

Rex

>Hi Rex.
>
>>> Sorry, I want to validate the info in the current record before allowing the record pointer to move. I understand that if the nColIndex does not change, you are changing rows. <<
>
>And yet another solution < g >. I put this in the BeforeRowColChange of my grid class:
>
>
>WITH This
>  IF .lValidatingRow
>    NODEFAULT
>  ELSE
>    .nRecNo = RECNO(.RecordSource)
>  ENDIF
>ENDWITH
>
>
>And this in AfterRowColChange:
>
>
>LOCAL lnRec2GoTo
>WITH This
>  IF .nRecNo = 0
>     RETURN
>  ENDIF
>  *** Save the current record number in case we have changed rows
>  SELECT (.RecordSource)
>  lnRec2GoTo = RECNO()
>  *** Check to see if the row has changed
>  IF lnRecNo # .nRec2GoTo
>    *** We are validating the row we are attempting to leave...set the flag
>    .lValidatingRow = .T.
>    GOTO .nRecNo
>    IF .ValidateCurrentRow()
>      GOTO lnRec2GoTo
>    ENDIF
>    *** Finished with validation...reset flag
>    .lValidatingRow = .F.
>  ENDIF   	
>ENDWITH    	
>
>
>ValidateCurrentRow is a template method that gets coded in the instance.
>
>Marcia
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform