How to Achieve Client Side Sorting without Postback

7 posts, 0 answers
  1. Srinivas Dhulipala
    Srinivas Dhulipala avatar
    8 posts
    Member since:
    Jun 2009

    Posted 06 Feb 2012 Link to this post

    Hi,
    Below is my requirement:
    I have a RadGrid with 10 columns. I need Client Side Sorting of all the columns without Screen Refresh or Postback.
    I have this Radgrid in a USer Control which is being used in many pages.
    I tried some of the approaches shown in the various threads in this forum, but all of them resulted in postback.
    Can you please send me a working sample of how this can be accomplished.
    Thanks 
    Srinivas Dhulipala
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Feb 2012 Link to this post

    Hello Srinivas,

    Take a look at the following demo.
    Grid / Declarative Binding

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 Feb 2012 Link to this post

    Hello,

    Take a look into the following forum thread which discussed the same.
    client side paging and sorting of RadGrid

    Thanks,
    Princy.
  5. Dan
    Dan avatar
    30 posts
    Member since:
    Oct 2013

    Posted 10 Aug Link to this post

    It seems to me that the Question is pretty straightforward:
    "How to Achieve Client Side Sorting without Postback" but what the user (and myself) is really trying to achieve is re-sorting the array without retrieving the data again. 
    Both of the responses here send the user to threads or examples that insist on do declarative binding which is just another way of getting the data again.
    It would appear to me that there is no Built in way to do this with Telerik Rad Controls. I suspect this has to do with the fact that the entire Grid is ajaxified and as such requires a postback?

    Can we please get an Admin person that really understands this to give us a straightforward answer?


  6. Eyup
    Admin
    Eyup avatar
    3007 posts

    Posted 15 Aug Link to this post

    Hello Dan,

    When binding your grid on server-side, it requires postback every time you initiate a rebinding action like Paging, Sorting, Filtering, etc. In order to optimize performance and improve greatly user responsiveness, you can ajaxify the grid. You can do that using RadAjaxManager or RadAjaxPanel:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/ajaxmanager/overview
    http://docs.telerik.com/devtools/aspnet-ajax/controls/ajax/radajaxpanel/overview

    You can check various live samples to see it in practice:
    http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/paging/basic-paging/defaultcs.aspx

    Alternatively, you can bind your grid entirely on client-side:
    http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/client-data-source-binding/defaultcs.aspx

    To wrap it up, it depends on your chosen binding approach. If the binding is server-side, a full PostBack or ajaxified partial CallBack must be done to the server to get the data anew. If the binding is client-side, you can update the grid using only javascript, without rendering the page all over.

    I hope this will prove helpful.

    Regards,
    Eyup
    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.
  7. Dan
    Dan avatar
    30 posts
    Member since:
    Oct 2013

    Posted 15 Aug in reply to Eyup Link to this post

    Hi Eyup,
    So, succinctly, one cannot re-sort the Grid without Rebinding!
  8. Eyup
    Admin
    Eyup avatar
    3007 posts

    Posted 18 Aug Link to this post

    Hi Dan,

    Yes, of course. The grid records should be refreshed in order to update their position, depending on the chosen sort mode (ASC, DESC, None) and field.

    Regards,
    Eyup
    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
UI for ASP.NET Ajax is Ready for VS 2017