Two different DomainDataSources use same DomainContext

6 posts, 0 answers
  1. W
    W avatar
    14 posts
    Member since:
    Apr 2016

    Posted 06 May Link to this post

    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.

  2. W
    W avatar
    14 posts
    Member since:
    Apr 2016

    Posted 09 May Link to this post

    Thanks for any help...any help...!
  3. DevCraft banner
  4. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 09 May Link to this post

    Hi,

    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
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  5. W
    W avatar
    14 posts
    Member since:
    Apr 2016

    Posted 09 May Link to this post

    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.

  6. W
    W avatar
    14 posts
    Member since:
    Apr 2016

    Posted 10 May Link to this post

    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.

  7. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 11 May Link to this post

    Hello,

    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
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
DevCraft banner