Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor in a grid
Message
From
09/03/2007 10:56:16
 
 
To
09/03/2007 10:52:00
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01201093
Message ID:
01202304
Views:
28
>Terry,
>
>>Sure you do. I've always been wary of this, because the grid would be expecting a record source before the cursor of that name had been instantiated. However, given this "safe" method now, and gleaning that the cursor is first created at .Load, I can see how this works.
>
>The main problem with this approach in the past has been the case where you need to pass in a parameter to the form that is needed for the where clause of the query. Getting the parameter in the Init and querying there is too late for the automatic binding to work.
>
>That's why the new BindControls form property was added in VFP8, allowing you to do the querying in the form's Init (with BindControls = .F. in the property sheet), then set BindControls = .T. when the data is ready.

Load event should have CREATE CURSOR statement making empty cursor, while Init event contains actual query. This way BindControls is not required.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform