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

Using RadGridView with EntityFrameworkDataSource

3 Answers 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Samuel
Top achievements
Rank 1
Samuel asked on 11 Jun 2015, 06:41 PM

I have a an MVVM app where a page has a gridview bound to an entitiyframeworkdatasource.  The data loads as soon as the page loads and takes a while... so it blocks the UI thread.  Is there a way to prevent this?  I tried using another thread but couldn't get it to work right.

 

Also, how would I go about saving and undoing changes?  I created a button to save where I just call SaveChanges on the context.. and that works... But if I revert all changed entities in the context, the grid doesn't update the rows.

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 15 Jun 2015, 01:15 PM
Hi Samuel,

The UI blocking happens while RadGridView realizes its items. In such case I can suggest you using IsBusy property of RadGridView and bind it to a boolean property in your view model. You will need to set its value to "true" before the loading process is started and to "false" after the process has finished. You may find the Tips and Tricks article useful on this matter.

As for your other question, generally, your business object should implement INotifyPropertyChanged interface in order the client side to be updated.

Please give the two suggestions a try and let me know if I can guide you any further.

Best Regards,
Stefan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Samuel
Top achievements
Rank 1
answered on 15 Jun 2015, 01:39 PM
If the UI thread is blocked, what good does setting IsBusy to true do?  The UI would be unable to display the busy indicator.  IN fact, i tried this and as expected, there was no difference.
0
Stefan
Telerik team
answered on 16 Jun 2015, 02:49 PM
Hello Samuel,

Indeed, you are right. Setting IsBusy property to "true" does not make RadGridView work on a separate thread. Please excuse me for this misunderstanding.

Unfortunately, for the time being, RadEntityFramework DataSource does not support asynchronous operations, as RadDataService DataSource, for example. 

Best Regards,
Stefan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Samuel
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Samuel
Top achievements
Rank 1
Share this question
or