QDSCV not loaded after new item is added

6 posts, 0 answers
  1. Ubuntu
    Ubuntu avatar
    89 posts
    Member since:
    Jul 2012

    Posted 09 Apr 2011 Link to this post

    Dear All,

    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
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 11 Apr 2011 Link to this post

    Hello Ubuntu,

    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.

    Best wishes,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Ubuntu
    Ubuntu avatar
    89 posts
    Member since:
    Jul 2012

    Posted 11 Apr 2011 Link to this post

    Hello Ros,

    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

  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 11 Apr 2011 Link to this post

    Hi Ubuntu,

    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.

    Best wishes,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Ubuntu
    Ubuntu avatar
    89 posts
    Member since:
    Jul 2012

    Posted 11 Apr 2011 Link to this post

    Hello Ross,

    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);
    }
    and here is where I delete the record & then call the refresh:
    public void Delete(object ignored) 
        DataService.DeleteItem(CurrentItem); 
        Items.Load(); 
       // Refresh("");
    }
    The Items is the QDSCV and CurrentItem is the Entity object.
    I hope you can help me in this matter.

    Best


  7. Ubuntu
    Ubuntu avatar
    89 posts
    Member since:
    Jul 2012

    Posted 13 Apr 2011 Link to this post

    Hello Ross,

    Don't bother I already figure it out !!

    Regards
Back to Top
DevCraft banner