This is a migrated thread and some comments may be shown as answers.

Invoke custom method

4 Answers 58 Views
Data Virtualization
This is a migrated thread and some comments may be shown as answers.
Waleed Seada
Top achievements
Rank 2
Waleed Seada asked on 17 Feb 2011, 01:15 PM
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

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 17 Feb 2011, 01:29 PM
Hi,

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

Kind regards,
Vlad
the Telerik team
0
Waleed Seada
Top achievements
Rank 2
answered on 17 Feb 2011, 01:40 PM
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

0
Vlad
Telerik team
answered on 17 Feb 2011, 01:57 PM
Hi,

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

Regards,
Vlad
the Telerik team
0
Waleed Seada
Top achievements
Rank 2
answered on 17 Feb 2011, 02:15 PM
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
Tags
Data Virtualization
Asked by
Waleed Seada
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Waleed Seada
Top achievements
Rank 2
Share this question
or