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

GridView, VirtualQueryableCollectionView, and WCF Service (not RIA)

3 Answers 135 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eugeniy
Top achievements
Rank 2
Eugeniy asked on 22 May 2011, 02:49 PM
Is any way to translate GridView filtering and sorting e t.c. options to the WCF Service so Service Method could do the things in LINQtoSQL datacontext? I just want to call Wcf Services in RIA manner

For example, at SilverLight Client Control we call the service method:

//SilverLight Client Control with DataGrid:
public class MyControl : UserControl
{
...
private IEnumerable<Employee> Search(GridViewOptions options)
{
   var asyncResult = myService.BeginGetEmployees(options);
   return myService.EndGetEmployees(asyncResult);
}
...
}

And at the Wcf Service:
[OperationContract]
public Employee[] GetEmployees(GridViewOptions options)
    using(var db = new DB()) //DB is the LinqToSql DataContext
    {
        return db.Employees
           .ApplyGridOptions(options)  //this is the thing i want
           .BeforeSending()   //it's my own method, which caches some related data, and fills custom fields in partial class Employee
           .ToArray();
    }
}
I found the class VirtualQueryableCollectionView. Could it help me?

I do not want to use RIA services because:
1) I want to call service synchronously in my customized SilverLight thread like this:
DoWork("Loading Genres...",(sender, args) =>
                               {
                                args.Result = Communication.Proxy.GetGenres();
                               },(o, eventArgs) =>
                                         {
                                              if(eventArgs.Error==null)
                                              {
                                                 genreGrid.ItemsSource = eventArgs.Result;
                                              }
                                         });

(i'm using my own tool, which generates wcf sync proxies)
2) The code is more clear.
3)I want to load and store some advanced data in the entities

3 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 25 May 2011, 06:36 AM
Hello,

 I've attached small example project to illustrate you how to achieve your goal with VirtualQueryableCollectionView and plain WCF/Web service. The server-side code of the project is exactly the same as the project in this blog post. 

Regards,
Vlad
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
0
Eugeniy
Top achievements
Rank 2
answered on 25 May 2011, 07:33 AM
Great.
But why grouping is not working?
0
Vlad
Telerik team
answered on 25 May 2011, 07:36 AM
Hello,

 Grouping is not supported currently with VirtualQueryableCollectionView. I've forgot to provide link to the blog post in my previous reply - here is it:
http://blogs.telerik.com/vladimirenchev/posts/10-01-14/how_to_server_sorting_filtering_grouping_and_paging_with_radgridview_for_silverlight_without_wcf_ria_services.aspx

Regards,
Vlad
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
Tags
GridView
Asked by
Eugeniy
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Eugeniy
Top achievements
Rank 2
Share this question
or