Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View Index
Message
From
01/11/2002 09:56:43
 
 
To
30/10/2002 17:38:25
General information
Forum:
Visual FoxPro
Category:
CodeMine
Title:
Miscellaneous
Thread ID:
00716870
Message ID:
00717798
Views:
13
>>I notice the cde.AfterOpenAll() fires before the parent form is even open (and this local view is in a child form). So, is this the only time the cde.AfterOpenAll() would actually fire?
>
>You need to forget about the form here. This is all about the CDE. A CDE could be used on its own without any form and you still get an AfterOpenAll event firing. The CDE (like a native DE) loads before the form. It has to so that any bound controls on a form have data sources to bind to. So, AfterOpenAll fires once and once only, after the OpenAll event is fired, after a CDE object is instantiated.
>
>>Am I correct in assuming that when the cdeAfterOpenAll() code fires, that there are actually no records loaded in the view (which in turn would mean the indexes would build initially very quickly)?
>
>Well, that depends <s>. If your view has its NoDataOnLoad flag set True, then the view will have no records in it and therefore you will index an empty cursor, which will be extremely fast. Generally, the navigation or record selection that triggers the querying of cursors happens when the form is loaded so, you would generally have NoDataOnLoad set True and therefore, you will generally be indexing an empty cursor at the point that AfterOpenAll fires.
>
>>And one final question today and I will let have the rest of the evening off to read that SQL 2000 book: after saving a new record in this Child Form, I need to refresh the grid on this form. Where is normally the best place to do this?
>
>Well, I guess it depends on the child form type. You can simpl
y sublcass your form's Save method, call dodefault() and then refresh the grid, or you could subclass the datamanager's afterupdate/afterupdateall method which fires after the data source has been updated. There are numerous places you could refresh the grid, all would work but obviously picking your location carefully may result in more efficient code.

So what do you think of putting it in the AfterRequery method in the cmRule?
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform