Solved

WCF dataservice serverside paging and silverlight datagrid clientside paging?

Posted on 2010-08-26
4
1,886 Views
Last Modified: 2013-11-12
Dear experts,

I have a WCF DataService with an ADO.NET Entity Framework model which is set on our test DB with 1 table in it called "Patient". This table contains 11000 records so I can test 'paging'. I've turned paging on in this service to 10 records ("config.SetEntitySetPageSize("Patients", 10)").

I have a client application in Silverlight which has a DataGrid. I've been able to set clientside paging on by using a PagedCollectionView and a DataPager.

The problem however is that this makes the serverside paging useless. Because now I have to retrieve all 11000 records 10 at a time (which is like 20 seconds delay or something) for the paging on the DataGrid to work (DataPager needs the full collection before it can calculate the number of pages ofcourse).

Isn't there a way to solve this elegantly? Basically what I want is for the datagrid to be able to retrieve the next 10 records from the WCF dataservice when the user presses 'next' on the DataPager.
0
Comment
Question by:Labelsoft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
SriVaddadi earned 500 total points
ID: 33541250
0
 
LVL 3

Author Closing Comment

by:Labelsoft
ID: 33565375
First off, excuse me for the delay. I've been puzzling with a colleague since you posted to figure it out.

We've finally got this stuff to work. It was for the most part link #2 you provided, so you'll get the credits.

We wanted it declarative in XAML because we want to use MVVM pattern on the client. In retrospect it made stuff quite complicated at first. Now we've got it to work it's quite simple (all thnx to WCF and Silverlight 4).

Quickly the basic steps (if anybody is interested in the exact details please feel free to contact us):

- Set up DomainService
- Give it the method to call (like for instance: GetCustomers())
- Set up DomainDataSource in XAML
- Hook up DataPager to DomainDataSource
- Hook up Grid to DataPager
- Override Count in DomainService if you want total pages on DataPager

Note: If you work with large datasets, don't forget to set up your web.config accordingly (maxReceivedMessageSize="2147483647" and maxItemsInObjectGraph="10000000" for instance).

Ok thnx! And again, contact us for details if you need it.
0
 
LVL 16

Expert Comment

by:SriVaddadi
ID: 33565426
Thanks for giving the details on your approach. I do know that DomainDataSource has an element in XAML.  Also I m not sure if you know about this but you could pass the UI element to VM through commanding whether its PRISM or MVVM light.  I agree but it would not be the best practice though as there would not be advantage of using MVVM but just an idea. MVVM is more like a discipline you should stick to in whatever may be the scenario.
0
 
LVL 3

Author Comment

by:Labelsoft
ID: 33574315
Well, to be honest, we haven't given it much thought. Now we realize that DomainDataSource and MVVM are not compatible. We are basically going to try to put the logic that the DDS does for you in a VM. It's not going to be easy, but we are going to try.
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question