Setting a grid view's sort property (but not actually sorting)

2 posts, 0 answers
  1. Michael
    Michael avatar
    4 posts
    Member since:
    Aug 2013

    Posted 24 Aug Link to this post

    Hi,

    I have an MVC grid view and I'm setting the current sort value of the grid programatically (similar to http://stackoverflow.com/questions/13863111/kendoui-programmatically-setting-grid-sort). I don't wish to actually sort the grid at the time I set the sort so I'm doing something like this 

    var grid = $("#ServiceAuth").data('kendoGrid');
    grid.dataSource.options.sort = [{ field: "AuthType", dir: "asc" }];

    and then when I do actually want to sort the grid:

    grid.dataSource.sort(grid.dataSource.options.sort);

    Data-wise this sorts the grid correctly, however the new sort isn't reflected on the indicators at the top of the grid. Is there a way to do this so the grid reflects the data sources sort property?

    Thanks in advance for your help

     

     

     

     

  2. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 26 Aug Link to this post

    Hello,

    The sort direction seems to be correctly reflected when I tested the scenario at least on my side. Could you check this example and let me know if I am missing something?

    Regards,
    Daniel
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
Back to Top