New Data Not Loading Promptly

7 posts, 0 answers
  1. Robert Kaucher
    Robert Kaucher avatar
    56 posts
    Member since:
    Oct 2010

    Posted 25 Mar 2011 Link to this post

    I am using the RadDragAndDrop to move items between two RadDomainDataSources. The drag and drop and changing of the entity's association is working flawlessly. However the RadDomainDataSources are not displaying the change when I initially invoke Load.

    I do have the LoadBehavior set to RefreshCurrent

    e.LoadBehavior =

     

    LoadBehavior.RefreshCurrent;

     


    I have even attempted to set a LoadDelay to run but it does not seem to actually cause a reload. If I wire Load to a button and click the button I see the data as expected. But that is in no way desired.
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 25 Mar 2011 Link to this post

    Hi Robert,

    How do you move entities between two domain data sources when they do not have UI?

    In case you are moving entities between two RadGridViews each bound to a RadDomainDataSource, then you will have to call the SubmitChanges methods of the two RadDomainDataSource in order to save the changes on the server. This is a client-server technology and if you want to persist what you see on the client (i.e. in your SL app), you have to call the SubmitChanges method of each RadDomainDataSource in order to save changes on the server.

    I hope this makes sense.

    To learn more about RadDomainDataSource please read the following blog posts:

    You can also learn more about the WCF RIA Services technology here.

    I hope this helps.

    Kind regards,
    Ross
    the Telerik team
  3. DevCraft banner
  4. Robert Kaucher
    Robert Kaucher avatar
    56 posts
    Member since:
    Oct 2010

    Posted 25 Mar 2011 Link to this post

    Ross, let me explain in greater detail. I have Three ListBoxes. The first two ListBoxes (A and B) are bound to forecastOwnerRadDomainDataSource (representing a collection of ForecastOwner entities). ListBox B is boud to the ForecastPart collection propert of the SelectedItem of ListBox A. ListBox B is RadDragAndDrop enabled.

    There is a second DomainDataSource, forecastPartsRadDomainDataSource, which has a list of all ForecastParts which do not have a ForecastOwner asigned to them. ListBox C is bound to it and ListBox C is also RadDragAndDrop enabled.

    When I drag from B to C or C to B I manually change the state of the ForecastPart object by setting it's ForecastOwnerID either to null or to the ID of the SelectedItem of ListBox A. All of this functionality works properly. I submit changes and the changes occur. I then manually call load events on the RadDomainDataSources but the new data is not displayed EVEN THOUGH I have set the LoadBehavior to RefreshCurrent. As I stated, if I wire Load to a button, it works. Everything within the drag and drop and UI works. The issue is the Load of the RadDomainDataSource.

    I don't believe I can just use itemsSource.Add(payload) as in the DragAndDrop examples as the entities are associated with two different DomainDataSources. So that is why I am doing things manually and reloading the RadDDSes.

    I attached a picture of the UI so it is easier to understand. I just changed "ListBox A" to a RadGridView to allow editing of the ForecastOwner entities. But that is irrelevant to the issue at hand. Thanks for your help!
  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 25 Mar 2011 Link to this post

    Hi Robert,

    I have two questions for which I need an answer:

    1. Is the AutoLoad property of the RDDS set to true.
    2. What happens when you replace RadDomainDataSource with the MS DomainDataSource? They have the same API, so you can very easily replace them.

    This is important.

    I am looking forward to hearing from you.

    Regards,
    Ross
    the Telerik team
  6. Robert Kaucher
    Robert Kaucher avatar
    56 posts
    Member since:
    Oct 2010

    Posted 25 Mar 2011 Link to this post

    Edit:
    I think it is working with the MS DomainDataSources. Let me do some more testing.

    AutoLoad is set to true. I changed the DSes to MS DomainDataSources and they behaved exactly as I expected they would. It works EXCEPT for the fact that items in ListBox C are not removed properly because the RadDomainDataSource and DomainaDataSource are not exactly the same. You can no longer access the LoadBehavior of the MS DomainDataSource, which is why I wanted to use the Telerik version. The MS DomainDataSource only merges the old data...



  7. Robert Kaucher
    Robert Kaucher avatar
    56 posts
    Member since:
    Oct 2010

    Posted 25 Mar 2011 Link to this post

    The only difference is that I am using

    forecastOwnerDomainDataSource.RefreshInterval = TimeSpan.FromMilliseconds(400);

    with the MS DOmainDataSource and it appears to be working flawlessly. For somereason I thought that I was not able to access the LoadBehavior of the MS DomainDataSource, but I was wrong. Thanks for teaching me Ross!

    I don't recall seeing a RefreshInterval attribute for the Telerik RadDomainDataSource or am I mistaken there as well?
  8. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 28 Mar 2011 Link to this post

    Hi Robert,

    RadDomainDataSource does not have a RefreshInterval built-in, but you can easily write your own with a simple DispatcherTimer that has a certain interval and which will call RadDomainDataSource.Load() on each of its Tick's.

    As for the LoadBehavior, it can be changed in the LoadingData event handler just before the query is sent to the server. You can change it by setting e.LoadBehavior to the one that you want.

    I hope this helps.

    All the best,
    Ross
    the Telerik team
Back to Top
DevCraft banner