Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Problem
Message
From
11/02/2004 19:39:44
 
 
To
11/02/2004 01:01:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00876127
Message ID:
00876523
Views:
30
This message has been marked as the solution to the initial question of the thread.
Likes (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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform