Initial sort not working on grid

Jun 21, 2016 at 5:46 PM
Hello,

I am trying to display my grid with default sorting applied to the id column, as below:
@Html.Grid(Model.Reports).Columns(columns =>
        {
            columns.Add(m => m.ReportID)
                .Titled("ID")
                .SetWidth(20)
                .Sortable(true)
                .SortInitialDirection(GridMvc.Sorting.GridSortDirection.Descending);            
            columns.Add(m => m.RecordNumber)
                .Titled("Rpt Num")
                .Encoded(false)
                .Sanitized(false)
                .SetWidth(40)
                .Sortable(true)
                .RenderValueAs(m => @<b> @Html.ActionLink(m.RecordNumber.ToString(), "CreateEditReport", "Home", new { recordnumber = m.RecordNumber }, null)</b>);    
...
But when the grid loads initially, no sorting is applied at all.
And sorting does work - if I click on the id column header, it sorts as desired. It just doesn't seem to fire when the grid is initially loaded. I need to know how I can get sorting applied to the grid before it displays.

Any assistance or advice is greatly appreciated.
Aug 8 at 9:30 PM
Maybe you should attempt to sort your data on the server side before returning it to your view, then when a column header is clicked, your data will be sorted appropriately.