Using RadGridView with EntityFrameworkDataSource

4 posts, 0 answers
  1. Samuel
    Samuel avatar
    8 posts
    Member since:
    Jul 2014

    Posted 11 Jun 2015 Link to this post

    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.

  2. Stefan
    Admin
    Stefan avatar
    1073 posts

    Posted 15 Jun 2015 Link to this post

    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
  3. Samuel
    Samuel avatar
    8 posts
    Member since:
    Jul 2014

    Posted 15 Jun 2015 in reply to Stefan Link to this post

    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.
  4. Stefan
    Admin
    Stefan avatar
    1073 posts

    Posted 16 Jun 2015 Link to this post

    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
Back to Top