New Posts New Posts RSS Feed: [SOLVED] Refreshing Data on Grid
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

[SOLVED] Refreshing Data on Grid

 Post Reply Post Reply
Author
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Refreshing Data on Grid
    Posted: 06-Oct-2007 at 9:12am
I have prepared a summary detail page where in the summary section (nope, not the detail) I have a grid.  I would like the grid to retrieve updates values from the database on a specified interval.  I have tried resetbindings, refreshdatasource, and other obvious methods, but nothing seems to work.  What is the command to get the grid to update its data without losing the current pointer?

Edited by Linguinut - 15-Oct-2007 at 10:40am
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 08-Oct-2007 at 4:49pm

Let me rephrase (for bumping purposes):

How do I update a  view-only grid with recent changes in the database, without closing the app and opening it again?
Back to Top
Bill Jensen View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Jul-2007
Location: United States
Posts: 229
Post Options Post Options   Quote Bill Jensen Quote  Post ReplyReply Direct Link To This Post Posted: 10-Oct-2007 at 12:29pm
It seems to me that if you periodically re-query the data and assign the resulting list to the grid's binding source, the grid should update automatically.
 
If the result of the original query was a managed list (e.g., EntityList<T>), then re-running the query should be sufficient without re-assigning the result.
 
Is this what you're doing?
 
Bill J.
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 10-Oct-2007 at 12:56pm
Yup...a managed list is involved.  I was hoping for a command that already existed that would refetch the data and refresh the grid.  I can certainly re-run the original query.  How would that affect my current pointer?  Should I store that first, requery, then repoint based on the stored pointer?
 
Also, can this be done asynchronously?  Are there things I need to watch out for if that is possible?
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 12-Oct-2007 at 12:44pm
Not working.  I have tried running a timer in the controller.  The timer goes off, so the code is properly running (similar to the GetInitialEntries code).  The MainBindingSource's datasource is getting reset.  But, the view doesn't see it that way.  Shouldn't the controller be the place to make this kind of thing happen?  If the MainBindingSource changes...shouldn't the binding managers that rely on this source change, too?  Yup, I called MainBindingSource.ResetBindings(false).  No dice.
 
(stares off, deep in thought)  Perhaps I should do this in the presenter...
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 15-Oct-2007 at 10:27am
Have you tried changing your query strategy to use DataSource then cache?
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 15-Oct-2007 at 10:40am
Thank you!  Thank you!  Thank you!
 
If it were a snake...
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down