WCF dataservice serverside paging and silverlight datagrid clientside paging?
Posted on 2010-08-26
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.