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

Paging Data with RadDataPager and a WCF Service

5 Answers 271 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Nirph
Top achievements
Rank 1
Nirph asked on 07 Feb 2011, 03:12 PM
Hello,

I have a WCF service operation that I use to get a list of customers. The service operation in question accepts a beginning and an end. It returns the data requested and the total count of results (i.e number of total customers).

My Questions:
A) How can I 'hook on' to RadDataPager so it uses the service when it needs to get data for a specific range/page? I.e Stream data when needed.
B) How can I get RadDataPager to shows the total items, even though the data source will only contain items for the current page. 

I would REALLY appreciate it, if you could show me how to pull this off with a quick WPF sample application. I have found a Silverlight one, but it doesn't seem to be working.

Thanks!

5 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 07 Feb 2011, 04:14 PM
Hello Conrad Botha,

This Silverlight code library should be working - just download the project and rebuild it.

The idea should be the same in WPF - first you need to set the ItemCount of RadDataPager, so it knows the number of the total items. Then you should subscribe to the PageChanged event of the pager and query your service to get the next results.

Please observe the silverlight code library and let me know if you face any problems.

Greetings,
Veselin Vasilev
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Johan
Top achievements
Rank 1
answered on 30 Nov 2011, 08:30 AM
Hello,

I am currently working on a Silverlight 4 project using WCF services,  Entity for database interaction and the 2011.2.920 version of the Telerik controls for Silverlight.

How can I get filtering, sorting, and grouping working for a RadGridview in conjunction with paging through a RadDatapager to work on a custom WCF service connecting to Entity framework without running WCF RIA services and Linq to SQL.

We are returning custom data contracts as we don't want our entities exposed to our front end.

Thanks
0
Vlad
Telerik team
answered on 30 Nov 2011, 08:46 AM
Hi,

 With plain WCF services you should write your own code to transfer all the info to the server. With WCF RIA services you can use RadDomainDataSource:
http://demos.telerik.com/silverlight/#DataServiceDataSource/FirstLook

Best wishes,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Johan
Top achievements
Rank 1
answered on 30 Nov 2011, 09:32 AM
Hi Vlad,

I do understand that I need to implement the service end myself.

How do I go about getting the filtering, grouping and sorting information from a RadGridView component to pass to my service?

Regards
0
Rossen Hristov
Telerik team
answered on 30 Nov 2011, 09:53 AM
Hello Johan,

We have three client-side data source controls:

RadDomainDataSource targets WCF RIA Services, you supply a DomainContext + EntityQuery<T>.

RadDataServiceDataSource targets WCF Data Services, you supply a DataServiceContext and DataServiceQuery<T>.

RadEntityFrameworkDataSource targets Entity Framework, you supply an ObjectContext and an ObjectQuery<T>.

I suppose that if you are using WCF Data Services you can go with the RadDataServiceDataSource. Please, read my blog post on the subject.

We have online examples of all three controls. If you bind RadGridView to any of these data source controls then the grid will automatically transfer its filtering, grouping, and sorting information to the data source control. The data source control on its turn will "translate" this filtering, grouping, and sorting information (stored in the form of *Descriptors) and apply it on its underlying query before sending it to the server. RadDataPager and RadDataFilter work in the same way when bound to a data source control.

If you do not use one of these controls, you will have to read this information from RadGridView and translate it yourself. This information is stored in the FilterDescriptors, SortDescriptors and GroupDescriptors properties of RadGridView. Translating it to your query would be your responsibility in this case.

The server-side part of the code will be your responsibility in all cases, since we build client-side controls only.

I hope this helps. Let me know if you need to know something else.

Best wishes,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
DataPager
Asked by
Nirph
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Johan
Top achievements
Rank 1
Vlad
Telerik team
Rossen Hristov
Telerik team
Share this question
or