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

DataView not updating after a load

2 Answers 80 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
plusHR
Top achievements
Rank 1
plusHR asked on 13 Sep 2011, 05:14 PM
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"
          Background="LightGray"
          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.

Thanks
Paul

2 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 14 Sep 2011, 09:09 AM
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.

Regards,
Ross
the Telerik team

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

0
plusHR
Top achievements
Rank 1
answered on 14 Sep 2011, 04:04 PM
Many thanks, of course! I must of been having an off-day :-) Thanks again for the prompt response.
Tags
DomainDataSource
Asked by
plusHR
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
plusHR
Top achievements
Rank 1
Share this question
or