Grid - Grouping (Server mode)


About this example


This demo shows DJME Grid using Server requests (HTTP GET) for grouping ,paging and sorting.In this demo using the customers data of Northwind database that generate by EF.

When you are using ModelBinder to generate the grid data source from server side, you need to specified the strong type to "IEnumerable",and inject the data model type to Grid(T model) method in your View. DJME Grid provides two Groupable methods :
  • Groupable() - Tell the Grid allows grouping and do nothing on data loaded.
  • Groupable(Action> groups) - Specified the grouping columns at first data loaded.

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="DNA.Mvc.Areas.Example.Models" %>

<% Ajax.Dna().Grid(Model)
           .Width(650)
           .Groupable(groups => {
               groups.Add(m => m.ContactTitle);
           })
           ...
           .Render();
%>