I'm new to Kendo and learning how to integrate it with MVC and display data in a grid.
My controller
[HttpGet]
public ActionResult StudentList([DataSourceRequest]DataSourceRequest request)
{
DataSourceResult result =
_acc.GetStudent(StudId).ToDataSourceResult(request,
model => new StudentModel
{
ID = model.ID,
StudId = model.StudId,
Name= model.Name,
Email= model.FullName,
custEmail = model.Email
});
return Json(result, JsonRequestBehavior.AllowGet);
}
My view
@(Html.Kendo().Grid<Models.StudentModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.StudId);
columns.Bound(c => c.Name);
columns.Bound(c => c.Email);
})
.Pageable()
.Sortable()
.Filterable()
.Scrollable(scr => scr.Height(550))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("StudList", "Student"))
.ServerOperation(false)
)
)
And the out put I am getting in my browser looks like
{"Data":[{"ID":1102,"StudId":4006,"Name":"Adam Lyon","Email":"alyon@regionofwaterloo.ca",",....,
Does anyone has any idea why the data is not formatted in a grid form?