Print Page | Close Window

[SOLVED] Refreshing Data on Grid

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=477
Printed Date: 13-Sep-2025 at 2:43pm


Topic: [SOLVED] Refreshing Data on Grid
Posted By: Linguinut
Subject: [SOLVED] Refreshing Data on Grid
Date 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?



Replies:
Posted By: Linguinut
Date 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?


Posted By: Bill Jensen
Date 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.


Posted By: Linguinut
Date 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?


Posted By: Linguinut
Date 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...


Posted By: orcities
Date Posted: 15-Oct-2007 at 10:27am
Have you tried changing your query strategy to use DataSource then cache?


Posted By: Linguinut
Date Posted: 15-Oct-2007 at 10:40am
Thank you!  Thank you!  Thank you!
 
If it were a snake...
 



Print Page | Close Window