Changing the WebGrid default sort to descending in ASP.NET MVC

Posted by Sheonarayan under ASP.NET MVC category on | Points: 40 | Views : 753
I was facing the problem of changing the default sort order of WebGrid in ASP.NET MVC. Here is the solutions.
   WebGrid grid = new WebGrid(Model, canPage :true, canSort:true, rowsPerPage : 50, defaultSort: "AutoId");
grid.SortDirection = SortDirection.Descending;


Comments or Responses

Login to post response