i am using kendo grid
my controller is here am passing the entity to my model then calling in view
public ActionResult samplem1([DataSourceRequest]DataSourceRequest request)
{
var t=GetCustomers().ToDataSourceResult(request);
return Json(t, JsonRequestBehavior.AllowGet);
}
private static IEnumerable<Northwindproduct> GetCustomers()
{
var northwind = new KaushikEntities();
var purchCount = northwind.tblEmployees.Count();
return northwind.tblEmployees.Select(product => new Northwindproduct
{
id = product.Id,
Name = product.Name,
Gender = product.Gender,
City = product.City
});
}
@( Html.Kendo().Grid<KendoUIMvcApplication2.Models.Northwindproduct>()
.Name("grid")
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(product => product.id))
.Read(read => read.Action("samplem1", "Home")
)
)
.Columns(columns =>
{
columns.Bound(product => product.City);
columns.Bound(product => product.Name);
columns.Bound(product => product.Gender);
})
.Pageable()
.Sortable()
)
i need the data to display in a kendo grid but am getting data as
{"Data":[{"id":1,"Name":"Mark","Gender":"Male","City":"London","DateOfBirth":"\/Date(-62135568000000)\/"},{"id":2,"Name":"John","Gender":"Male","City":"Chennai","DateOfBirth":"\/Date(-62135568000000)\/"},{"id":3,"Name":"Mary","Gender":"Female","City":"New York","DateOfBirth":"\/Date(-62135568000000)\/"},{"id":4,"Name":"Mike","Gender":"Male","City":"Sydeny","DateOfBirth":"\/Date(-62135568000000)\/"},{"id":5,"Name":"Scott","Gender":"Male","City":"London","DateOfBirth":"\/Date(-62135568000000)\/"}],"Total":5,"AggregateResults":null,"Errors":null}