This is a migrated thread and some comments may be shown as answers.

Database Pagination for RadGrid, not Page UI Pagination

3 Answers 420 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nilay Shah
Top achievements
Rank 1
Nilay Shah asked on 17 Aug 2016, 07:55 AM
Hi,

Does RadGrid has built-in Database Pagination in addition to the standard Grid UI Pagination?

For example:

In RadGrid standard Page UI Pagination, if you have page size of 25, when the data source is bound then the whole dataset (e.g. 500 member records) is retrieved from the database, but only renders the first 25 records. When the user clicks to go to page 2 the query is run to get the 500 records again and the telerik control will then render the next batch of 25 records in order. Does RadGrid has built-in Database Pagination in addition to the standard Grid UI Pagination that can limit the records retrieved from the database to, say 100 records rather than retrieving 500 records?

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 18 Aug 2016, 12:19 PM
Hello Nilay,

The behavior you describe is not directly related to RadGrid. This is a functionality provided by the DataSource control. For example if you use SqlDataSource Control it will retrieve all records from the database and pass them to the grid. Then RadGrid will page the items internally.

On the other hand the EntityDataSource provides more advanced query mechanisms. It can retrieve only the items that will be displayed. This should considerably improve performance. You can check that in action in the following online example.


If you bind RadGrid in the code-behind you would need to implement Custom Paging. You would need to use additional logic to request only the relevant items from the database and pass them to the Grid. The demo below outlines the approach you can use to implement the behavior.



Regards,
Viktor Tachev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Nilay Shah
Top achievements
Rank 1
answered on 18 Aug 2016, 06:27 PM
How can you use SQLDataSource to do the database pagination for RadGrid? What options do you need to use?
0
Viktor Tachev
Telerik team
answered on 23 Aug 2016, 11:47 AM
Hi Nilay,

The SqlDataSource does not provide the same features as EntityDataSource out of the box. If you prefer not to use EntityDataSource and still return only the relevant records from the database you would need to implement Custom Paging.



Regards,
Viktor Tachev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Nilay Shah
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Nilay Shah
Top achievements
Rank 1
Share this question
or