Invoke custom method

5 posts, 0 answers
  1. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 17 Feb 2011 Link to this post

    Dear All,

    Is it possible to Invoke custom method using VQCV from RIA DataService, which return only one value (int or string).

    Best regards
    Waleed

  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 17 Feb 2011 Link to this post

    Hi,

     If you are referring to ItemsLoading event of the collection you can invoke anything. 

    Kind regards,
    Vlad
    the Telerik team
  3. DevCraft banner
  4. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 17 Feb 2011 Link to this post

    Dear Vlad,

    Appreciate your fast reply.
    I have the following method on the domainservice:
    [Invoke]
    public int GetMaxID()
    {
        int id = Get_People().OrderBy(p => p.peolple_id).ToList().Last().peolple_id;
        return ++id;
    }

    in my VM I am doing this:

    public void GetNewID()
    {
        var query = Context.GetMaxID();
        var view = new VirtualQueryableCollectionView() { LoadSize = 10, VirtualItemCount = 100 };
        view.ItemsLoading += (s, e) =>
                                {
                                    Context.Load<int>(query).Completed += (sender, args) =>
                                                                            {
                                                                                  
                                                                            };
                                };


    I got an error in the Load<int> ... how can I procced from there ...

    Best regards
    Waleed

  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 17 Feb 2011 Link to this post

    Hi,

     I believe that this is not related to the VirtualQueryableCollectionView. What's says the error? 

    Regards,
    Vlad
    the Telerik team
  6. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 17 Feb 2011 Link to this post

    You know this red error :

    the int parameter should be conferrable to client.entity in order to use it as parameter ... check the attached image for more details.

    Best regards
Back to Top
DevCraft banner