Hi,
json and server mode is rendering the grid properly but in my Rhino Entity Framework profiler I can see that the grid is always requesting all rows.
This is my Index.cshtml for json mode:
@using start.Models;
@model IEnumerable<Adresse>
@{ ViewBag.Title = "Index";}
<h2>Index</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<div class="sample-panel-margin" style="width: 95%;">
@(Html.Syncfusion().Grid<Adresse>("GenericListGrid")
.ActionMode(ActionMode.JSON)
.Caption("Student Details")
.EnablePaging()
.EnableSorting()
.Column(cols =>
{ cols.Add(p => p.NAME1).Width(150).HeaderText("Name");
cols.Add(p => p.VORNAME).Width(100).HeaderText("Vorname");
cols.Add(p => p.STRASSE1).Width(200).HeaderText("Strasse");
cols.Add(p => p.HAUSNR).Width(60).HeaderText("Haus Nr.");
cols.Add(p => p.PLZ).Width(80).HeaderText("PLZ");
cols.Add(p => p.ORT).Width(200).HeaderText("Ort");
cols.Add(p => p.TELEFON).Width(150).HeaderText("Telefon");
cols.Add(p => p.EMAIL).Width(200).HeaderText("E-Mail");
}))
</div>
----------------------------------------------
Controller:
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using start.Models;
using System.Collections;
using Syncfusion.Mvc.Grid;
using Syncfusion.DocIO.DLS;
using Syncfusion.Pdf;
using Syncfusion.XlsIO;
namespace start.Controllers
{
public class AdressenController : Controller
{
private Context db = new Context();
//
// GET: /Adressen/
public ActionResult Index()
{
var data = new Context().Adressen.ToList();
return View(data);
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(PagingParams args)
{
IEnumerable data = new Context().Adressen.ToList();
return data.GridActions<Adresse>();
}
I am using Visual Studio 2012, Entity Framework 5, Syncfusion.Grid.MVc 11.144.0.21.
I am expecting that a paged grid is only requesting 15 records when pagesize is set to 15.
What am I doing wrong?
Sidenote: Same is working properly when I created the same grid with KendoUI.
Regards,
Michael