none
WPF DataGrid bound to entity framework 4.1 DbSet<T>.Local doesn't refresh on single entity reload RRS feed

  • Question

  • Hi All,

    I have a WPF DataGrid bound to a context.Customers.Local. Users can edit single entities through a detail form. The entity to be edited is passed to detail form viewmodel constructor. When the user click the cancel button i perform a reload of the single entity, but it seems that Local ObservableCollection isn't updated.

    By now, I use this code:

    context.Entry( entity ).Reload();
    ICollectionView view = CollectionViewSource( context.Customers.Local );
    view.Refresh();
    

    But I would like to ask why the Local collection isn't updated??

    Thanks in advance,

    Fulvio Esposito

    Monday, October 31, 2011 10:09 AM

Answers