This demo shows DJME Grid using Server requests (HTTP GET) for paging, sorting, filtering and grouping.In this demo using the customers data of Northwind database that generate by EF.
Before we binding the Customer data model to Grid we need to write a data source Action which getting the customer data from database. and then[Pagable] // 1.Add PagableAttribute on your Action public ActionResult Contacts(QueryParams _params) // 2.Add QueryParams param as Action parameter { var db = new NorthWindEntities(); //3.Using ModelBinder.BindForGrid method to generate pageable,sotable,groupable data. return View(ModelBinder.BindForGrid(c => c.CustomerID, db.Customers, _params)); }
<% Ajax.Dna().Grid(Model) .Columns(cols=>{ //Binding the columns which need to display cols.Bound(m=>m.FieldNameHere); ... }) .Pagable() .Sortable() .Render(); %>
<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage" %> <% Ajax.Dna().Grid(Model) ... .Groupable() .Render(); %>