How do I change the defaultSort
of my webGrid
to be in the opposite/descending order? If it were SQL, I'd be adding a DESC
somewhere. Here's my working line of code for an Ascending sort:
var grid = new WebGrid(dq, rowsPerPage: 50, defaultSort: "UWDate", ajaxUpdateContainerId: "grid" );
It correctly sorts on the UWDate
column in Ascending order, but I would like it to sort the opposite/descending order.
Another option is after your grid initialization:
grid.SortDirection = SortDirection.Descending;