I have a DataForm and a GridView binding to two different DomainDataSources(use same DomainContext).
The DataForm.CurrentItem's navigation property able to modify from GridView.SelectedItem.
The first load GridView is fine,when I reload,the GridView's DomainDataSource didn't load(same query).
Even LoadingData not raised, so set e.LoadBehavior = LoadBehavior.RefreshCurrent is invalid.
5 Answers, 1 is accepted
Could you clarify why you are working with two different instances of RadDomainDataSource? What is the behavior that you want to achieve?
Regards,
Maya
Telerik
Thanks for reply me.
I have a DataForm in a page. The navigation property use HyperlinkButton,when click the HyperlinkButton,then popup a Childwindow.
The Childwindow contain a GridView and a DomainDataSource, the DomainDataSource.DomainContext came from the page.
When the Childwindow closed, the DataForm in the page will get the GridView.SelectedItem to set DataForm.CurrentItem's navigation property..
The issue is:First click the HyperlinkButton to open the Childwindow is fine, the second time, the DomainDataSource in Childwindow LoadingData not raised.
The reason why use same DomainContext is: Can't set entity's navigation property,which from two different entitycontainer.
I see now.
If DomainDataSource is changed, the HasChanges will be set true, and CanLoad will be set false.
Then any load will be canceled.
Generally, you can try working with QueryableDomainServiceCollectionView and share the same instance of the collection. More information can be found in the "MVVM approach to Telerik Domain Services" article.
Regards,
Maya
Telerik