I hope this is the correct place for my post.
I have started evaluating OA days ago, I then start using the QDSCV collection to fetch some items from database.
I have a QDSCV to load data from one of my database tables, I can edit any of them and submit using OA no problem but when I try to add new items, although the item is committed successfully at OA, the QDSCV doesn't load the entities at all.
I have a refresh button, when I hit it after the new item is added it shows up the entities. what is the difference here ...
I am using a BackGroundWorker to do the job while the page is loading, and I am just calling the same function after I save the new item, it is also called from the refresh button.
Does it make any sense.
Best
5 Answers, 1 is accepted
When you make changes, you have to call the QDSCV.SubmitChanges method so that it submits the pending changes to the server. The QDSCV will submit the changes and then automatically Load from the server so that the view it shows is up-to-date.
Alternatively, you can call DomainContext.SubmitChanges and then do a manual call to QDSCV.Load, because if the QDSCV is not the one that submits the changes, it will have no clue that something has happened and that is why you have to manually call its Load method.
I hope this helps.
Ross
the Telerik team
I guess this is what I asked about.
I am currently using OA to submit-changes Not the QDSCV and the problem arise when the QDSCV is not refreshed although I call the reload method after submitting the data. But If I press the button it works ... what is the difference ...
Best
I am not sure. I can't tell without being able to debug your project.
What exactly does this button do? What happens if you use a "normal" WCF RIA domain service instead of OA? In other words, if you temporarily remove OA and target your sample project against the default domain services with EF -- is the behavior the same or different?
Alternatively, what happens if you use a DomainCollectionView instead of the QDSCV. They serve the same basic purpose. Is the behavior the same or different?
By the way, why aren't you submitting the changes through the QDSCV? I guess that if you don't submit them through it, something might go wrong, but I am not sure.
Ross
the Telerik team
I was using EF. and everything was okay, because I was submitting the changes using the QDSCV, But I want to use the OA instead and I am handing the exceptions that way, also I want to centralize the CRUD operation using OA, right approach .. I guess.
I will try the DCV.. today.
I guess it is something with the Async. calling, I mean I call the two functions sequently, so the second one (which is the load) is not taking the time to do it's job.I believe I need to wait until the commit finish then call the load, but I can't see how can I do that, If you can help me will be great.
The button is calling the refresh method that is using the Background worker. I just call that method after submitting the changes.
Here is the refresh method:
private
void
Refresh(
object
Ignored)
{
Comments =
""
;
IsBusy =
true
;
bw.RunWorkerAsync(Items);
}
public
void
Delete(
object
ignored)
{
DataService.DeleteItem(CurrentItem);
Items.Load();
// Refresh("");
}
I hope you can help me in this matter.
Best
Don't bother I already figure it out !!
Regards