Paging Data with RadDataPager and a WCF Service

6 posts, 0 answers
  1. Nirph
    Nirph avatar
    2 posts
    Member since:
    Nov 2009

    Posted 07 Feb 2011 Link to this post

    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!
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 07 Feb 2011 Link to this post

    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>>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Johan
    Johan avatar
    2 posts
    Member since:
    Nov 2011

    Posted 30 Nov 2011 Link to this post

    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
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 30 Nov 2011 Link to this post

    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 >>

  6. Johan
    Johan avatar
    2 posts
    Member since:
    Nov 2011

    Posted 30 Nov 2011 Link to this post

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

    Posted 30 Nov 2011 Link to this post

    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 >>

Back to Top
UI for WPF is Visual Studio 2017 Ready