Introduction One of the problems I met in Silverlight 2 was paging option in viewing large data content. And to do this I googled this and found several good examples but the best was done by Manish Dalal. In every click to “next” the new set of data is taken from list. I search about this problem and found a helpful post:
Stealth paging refers to the concept of retrieving data in background just before it is needed. You start by loading DataGrid with only one or two pages worth of data, just enough to cover the screen and some more. Now when user starts scrolling, and nears the end of available rows to show, we fetch additional data and add it to the data collection. User continues scrolling, without ever realizing that data was fetched in the background. [from this blog] In this article I post the modified version of the Datagrid paging: {codecitation class="brush: csharp; gutter: true;" width="650px"} public class PeopleService { [OperationContract] public List GetData(int startRow, int endRow) { List personList = new List (); for (int i = startRow; i < endRow; i++) { personList.Add(new Person() { //get row i from the database FirstName = string.Format("Ali"), LastName = string.Format("Veli"), Age = i, City = string.Format("Izmir"), }); } return personList; } } {/codecitation} I hope this help to you lot and save time to work in silver light paging.
Download Source Code Thank you Hüseyin Çakır http://huseyincakir.wordpress.com/
|