Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Preventing Grid Navigation
Message
From
15/07/1998 23:23:21
 
 
To
15/07/1998 21:35:01
Richard Hackett
Dr Dick's Software Inc
Edmonton, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00117952
Message ID:
00117981
Views:
20
>Hi
>
>I'd like to prevent the user navigating away from a record in a parent grid while the form is in editmode. This grid class is for use in a class library. This can be achieved in single-user systems by storing the recordnumber before going into editmode and checking RECNO() in AfterRowColChange(), then navigating back there. However the problems of user updates, delete conflicts etc. on multi-user systems are formidable.
>
>I don't want to fiddle with the When() method of every textbox and column in my applications,and unless I use a builder 100% of the time it is tiresome to edit every object within every grid. In other words, I expect to use the base VFP header and textbox classes in grids at least some of the time. If I used custom classes for these 100% of the time, perhaps I could return .F. in When() if we're on the wrong record and everything might be OK. But that is quite a committment.
>
>Any other ideas?? How can I write code into the When()s of certain contained objects at runtime, should I expect a new answer with the control of events in VFP 6.0...
>
>TIA


If you are letting users navigate back and forth with a grid, why not set buffering to 5 (table buffering), and do your validation when the user exits?

If you are stuck on preventing a user from changing rows, you can do this by issuing a NODEFAULT in the grid.BeforeRowColChange event.

As an aside, you can use your own textboxes in grids at the class level by creating a grid with more columns than you'll ever need, setting properties and members as you wish, and then removing columns at run time.

For more options, check out my article here in the kb called 'Ideas for a Better Grid' HTH
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform