DataView not updating after a load

3 posts, 0 answers
  1. plusHR
    plusHR avatar
    58 posts
    Member since:
    Aug 2012

    Posted 13 Sep 2011 Link to this post

    I have a RadDomainDataSource on my page and this is passed to various user-controls that will load data base don certain events. However in the usercontrol when I do a load the DtaaView is not changed to show the new loaded items;

    Definition in my main parent page
    <Grid x:Name="LayoutRoot"
              DataContext="{Binding ElementName=dds, Path=DataView}">

    Datasource is passed to the usercontrol as a property
    public Telerik.Windows.Controls.RadDomainDataSource DataSource { get; set; }

    Then I call a load operation
    AppDomainContext ctx = this.DataSource.DomainContext as AppDomainContext;
                 ctx.Load<data_PERSON>(ctx.AdminPeople_GetEmergencyContactsQuery(), LoadBehavior.MergeIntoCurrent, true);

    Therefore I would then expect the DataView to change to to the new loaded entities.

  2. Rossen Hristov
    Rossen Hristov avatar
    2478 posts

    Posted 14 Sep 2011 Link to this post

    Hello Paul,

    That behavior is expected and is by design.

    When working with RadDomainDataSource, you are not supposed to work directly with the DomainContext anymore, since the RDDS will not "know" what is going on. Once you "give" the DomainContext to the RDDS, you should not touch anything on it.

    Please use the respective RadDomainDataSource methods, for example Load if you want to load the data. Eventually, this will call DomainContext.Load in the end, but it does many other things before that.

    You might find my series of blogs interesting, in case you have missed them:

    Let me know if there are problems with the approach that I have suggested.

    the Telerik team

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

  3. plusHR
    plusHR avatar
    58 posts
    Member since:
    Aug 2012

    Posted 14 Sep 2011 Link to this post

    Many thanks, of course! I must of been having an off-day :-) Thanks again for the prompt response.
Back to Top