Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursor in a grid
Message
De
09/03/2007 11:41:17
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
09/03/2007 11:29:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01201093
Message ID:
01202331
Vues:
30
>>>>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.
>>
>>An alternative exists. During a called form's .load we can access the calling form. If that form has a parameter object property, the called form can get it. This way we can query immediately without the create cursor. :)
>
>Absolutely, accessing other form properties is better way than sending parameters, especially for modeless form interaction. However, I would put 'query' code to separate form.method, because it will be called from many places; and this indicates that Load should still be limited to creating empty cursor, because 'query' method cannot be called yet.

It only indicates that you can call the query method from the form load after "accessing" the parameter object in the calling form.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform