Best practice to implement RadGrid (sorting, pagination, filtring, ...)

2 posts, 0 answers
  1. Zakaria
    Zakaria avatar
    4 posts
    Member since:
    Sep 2018

    Posted 04 Oct 2018 Link to this post

    Hi,
    I integrated a Telerik – RadGrid control, that I bound to a large DataSource (server side), using an SQL request that join two tables having 2 000 000 rows.
    I used RadAjaxPanel to avoid post back and reduce the response time.
    The problem is that in every NeedDataSource event, I select all the 2 000 000 rows from the DataBase, which takes a long time.
    To fix this problem I edited the SQL request using the arguments of the RadGrid (PageIndex and PageSize). But we have an application that includes a 200+ Grid, so we can’t do the same big modification to all the grids.
    Is there a solution or a better way to implement pagination, sorting, grouping, … without having to select all the DataSource from DataBase? Or if there is a way autogenerate SQL Request in pagination, sorting, grouping, …
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4502 posts

    Posted 04 Oct 2018 Link to this post

    Hi Zakaria,

    I've just answered your support ticket with the same question and I am pasting the answer here for anyone else with a similar query.

    When handling such large data sets, the general approach is to optimize the queries through the application code, as the built-in operations of the grid require the entire data set, which will, obviously, be too heavy. Usually, such optimizations are implemented through some sort of data-access-layer in a business application that takes care of caching, optimizing queries and implementing fast operations like paging, sorting and so on.

    I must also note that RadAjaxPanel does not remove postbacks. What it does is to use partial page rendering. This means that the POST query is almost identical, the server lifecycle of the page is identical, only the response is different - partial rendering only renders the part of the page that will be redrawn on the client, and not the entire page. This means that the same code runs as with full postbacks and this often includes data retrieval. This is why implementing data caching can often be crucial for business applications.


    Regards,
    Marin Bratanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top