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

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

1 Answer 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 24 Aug 2016, 08:55 AM

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

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 26 Aug 2016, 07:05 AM
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.
 
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or