Database Pagination for RadGrid, not Page UI Pagination

4 posts, 0 answers
  1. Nilay Shah
    Nilay Shah avatar
    4 posts
    Member since:
    Jul 2009

    Posted 17 Aug Link to this post

    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?
  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 18 Aug Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nilay Shah
    Nilay Shah avatar
    4 posts
    Member since:
    Jul 2009

    Posted 18 Aug in reply to Viktor Tachev Link to this post

    How can you use SQLDataSource to do the database pagination for RadGrid? What options do you need to use?
  5. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 23 Aug Link to this post

    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.
Back to Top