Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where do I refresh that view?
Message
From
04/04/2002 14:17:48
 
 
To
04/04/2002 10:27:32
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00639725
Message ID:
00641025
Views:
17
>Yes the grid is based on the view. I don't see why I should refresh the grid
>instead of requerying the view?

OK. I don't know the full story about your code but look at it this way.

You initially populate your view and the view "feeds" your form. During use of the form, you may add, deleted or modify records in the view. If this is the case, you want these changes to show in your grid which uses the view as its recordsource.

Why would you requery the view when you already have the changes in it? If your grid which is on another page of a page frame is not reflecting the changes you have made to the view in the form editing session, then simply refresh the grid. Why make a round trip to the server to requery the view when the changes are already in the view in the forms DE or CDE ?

>Is there really one better than the other.

Its not which one is better, its a matter of which is more appropriate in any given circumstance.

>In another reply I showed you that I requeried in AfterUpdateAll (in CDE) so
>to me that is better from an n-tier perspective than putting code in the grid to refresh it?

Requerying a view, when you need to is probably better delegated to the CDE. But if activity in the form has rendered the grid out of sync with the data, then this is a UI issue, so refresh the grid in the pageframe's page activate event. Refreshing the grid is not requerying the data. The view is up to date in the DE that the form is using so why requery at this stage?

However, if you have changed the PK value on which the view is based, then you requery the view. If you have simply added/deleted/modified data in the view using form actions, then as the changes have been made, I can't see why you would want to requery the view ?

>Unless there's a way to refresh the grid from the CDE?

Well yes, you could refresh the grid from the CDE by :-

this.oform.grdGridName.refresh()

but only if it is appropriate to do this.
-=Gary
Previous
Reply
Map
View

Click here to load this message in the networking platform