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.
6 Answers, 1 is accepted
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:
- Introducing RadDomainDataSource for Silverlight
- Loading data with RadDomainDataSource for Silverlight
- An MVVM Approach to Telerik Domain Services for Silverlight
- Creating CRUD application with RadDomainDataSource for Silverlight
- Why we have built RadDomainDataSource for Silverlight?
I hope this helps.
Ross
the Telerik team
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!
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.
Ross
the Telerik team
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.
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?
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.
Ross
the Telerik team