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

QueryableDomainServiceCollectionView not loading query

1 Answer 38 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Valentin Raceanu
Top achievements
Rank 1
Valentin Raceanu asked on 05 Dec 2011, 03:35 PM
A few details of my application:
  • Silverlight, Ria Services
  • I use an application-wide domain context even though I have multiple pages
  • I use MVVM design pattern with QueryableDomainServiceCollectionView (QDSCV)

In page1 I have a RadGridView that binds to UsersView:
public class UsersManagementVM : INotifyPropertyChanged
    {
        static UMContext _umCtx = DomainContexts.UserManagementContext;
         
        class UsersCollectionView : Telerik.Windows.Data.QueryableDomainServiceCollectionView<Users>
        {
            public UsersCollectionView(DomainContext domainContext, EntityQuery<Users> entityQuery)
                :base(domainContext, entityQuery)
            {
                AutoLoad = true;
            }
        };
 
        public Telerik.Windows.Data.QueryableDomainServiceCollectionView<Users> UsersView
        {
            get
            {
                return vUI.Manager.FromCache<UsersCollectionView>(delegate
                {
                    var y = new UsersCollectionView(_umCtx, _umCtx.GetAllowedUsersQuery(CurrentUser.UserId));
                }
            }
        }
    }

The problem is that when I modify the domain context in another page and go back to page1 then GetAllowedUsersQuery is not called anymore.

Thank you!

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 05 Dec 2011, 04:56 PM
Hi Valentin Raceanu,

When you have made changes to the DomainContext, you have to either submit or cancel them before you can load again. The alternative is to use different contexts for viewing and editing purposes.

All the best,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Valentin Raceanu
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or