This is a migrated thread and some comments may be shown as answers.

How to refresh data for RadGridView in multi user environment where multiple users are updating and viewing the same records

2 Answers 128 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 12 Jun 2014, 07:39 PM
Hello.  I am trying to solve the problem of keeping our data fresh using the Telerik WPF RadGridView.  I know that Telerik loads an in-memory copy of the collection that it binds to, but is there a way to keep it fresh?  We have a grid that queries 45,000 records.  Currently we have it working with a plain old windows grid by laoding in a page size at a time of records.  Because it goes back to the database each time we click the page buttons or do a sort or filter, the data stays fresh.  On the other hand, I also have a Telerik grid that queries the same set of records, but since it does not go back to the database for page operations and sorting and filtering, it gets stale data.  I verified this by updating some of the database fields and observing the old values instead of new ones.  Our work environment demands that the data be as fresh as possible (not just for insertion and deletion of records but for updating of existing records).  We have kicked around several ideas such as a refresh button, having a timer that goes back to the database to load every 15 minutes, or doing a database pull each time that the user does a paging, sort, or filter operation.  However, I am having a hard time finding the event in the RadGridPager that will let me make this call in the view model.  Is it even exposed?  Keep in mind that we are using MVVM, so I can use code behind if needed, but I would like to avoid that if possible.  Thank you.

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 16 Jun 2014, 02:56 PM
Hello Mike,

Generally, if you implement INotifyPropertyChanged interface in your business object, RadGridView should know about those changes and update them right away. If you work with RadDataPager, you can handle its PageIndexChanging/PageIndexChanged events. If more appropriate you can work with EventToCommand pattern and handle those actions in your ViewModel. Is that what you are working for or am I missing anything ?

Regards,
Maya
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Mike
Top achievements
Rank 1
answered on 16 Jun 2014, 03:55 PM
Thanks, Myra.  Yes, we are moving toward handling those events in our viewmodel, which I have figured out how to do after posting this thread.  Thank you for your response.
Tags
GridView
Asked by
Mike
Top achievements
Rank 1
Answers by
Maya
Telerik team
Mike
Top achievements
Rank 1
Share this question
or