3

Can I have a general idea of server-side paging? What are the steps? I am working on Silverlight DataGrid and the requirement is to use server-side paging. I did google but stumbled, reason being too much advance information in almost every article for a newbie like me. Also most of them used WCF RIA services which I have no idea. I just need to know how actually you do server side paging and if someone could guide in the Silverlight scenario that would be great.

The Idea is to send the no of records/page,order by/sorting,page no as parameter to the stored procedure and bind the results of PagedCollection to the DataGrid Source.

3
  • server side paging means you need to get data from database based on client's selected page ? Commented Jan 27, 2016 at 10:50
  • SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY EmpID) AS Row, * FROM Employee AS tbl ) WHERE Row >= @PAGE_NUMBER AND Row <= (@PAGE_NUMBER * @PAGE_SIZE) Commented Jan 27, 2016 at 10:53
  • @DarshanPatel can you please explain your suggested method of server side paging? Whats the idea behind this SQL query? Commented Jan 27, 2016 at 12:09

1 Answer 1

1

Server side, means that something works on server or it works at computer where IIS is installed. Client side means that something works in browser. If to speak about architecture XAML, and it's .cs code and anything related to silverlight part are compiled into .XAP file and executed in browser, by silverlight plugin - so it's client-side. So server side paging means that you need to make some C# code on the server, which will return you only requested page. For example you have 160 records, and at single page you want to show 10 records. Without server side paging each time you give to client ( or something that works in browser ) 160 records, and silverlight will filter from it 10 records. But with server side paging you'll return only 10 records, and Silverlight part will need only to show number of the page and records itself.

Sign up to request clarification or add additional context in comments.

6 Comments

why not through SQL? you can get required data from SQL
Cool. I now know what is server-side paging. Now wondering, do I have to make a call to the method(to retrieve next rows) every time user clicks on the pages? Like first 10 rows are loaded in the beginning, as user clicks on Page 2, another call will be made to run the SP and retrieve the next 10 rows?
It depends from how heavy is your system loaded. If you have five users simultaneously, which will use your system I don't think you need to worry about calling multiple times. But if your system will be loaded much more heavy, you can think about some kind of caching. P.S. if my answer gives you correct understanding please mark it as answer
@darshan-patel if you wish, you can directly make call from C# at client side to db as well. I just proposed the way to which I'm used and all places where I worked had the same approach. But if you wish, you can make direct calls to db from client side. I just suppose that this approach will be hard to unit test with mocking, also it can be challengeable to make it flexible with different dbs ( MS-SQL, Oracle, MongoDB )
@YuraZaletskyy I have designed a Stored Procedure that would take the startingRowIndex and Maximum no of rows to display per page. That's the logic. Just like we do in ASP.NET GridView with ObjectDataSource . So wondering if I can do similar thing in Silverlight. Like how will I configure DataGrid and DataPager?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.