Grid - Sorting (Client mode)


About this example


The DJME Grid allows you to sort data against an unlimited number of columns. The column's current sort order is indicated by a sort glyph displayed at the column header's rightmost edge. Click the column's header to sort data against a given data column or change the column's sort order.

Use the Sortable method to enable sorting data feature. And you can set the sorting fields in this method to specify default sorting.

<%
   Ajax.Dna().Grid()
         .ClientBind(Url.Action("ClientBinding", "Grid"))
         ...
         .Sortable(cols=>{
           cols.Add(m => m.CompanyName);
           cols.Add(m => m.City, SortingOrders.Desc);
         })
         .Render();
%>