Here is my Action Method
public ActionResult Kendo([DataSourceRequest]DataSourceRequest request )
{
var emp = EmployeeManager.GetAllEmployees();
DataSourceResult result = emp.ToDataSourceResult(request);
return Json(result);
}
This is my grid code which i have taken from official website
@model IEnumerable<MyProject.Web.Models.EmployeeViewModels.EmployeeViewModel>
@using Kendo.Mvc.UI;
@(Html.Kendo().Grid<TalentPro.Employees.Employee>()
.Name("grid")
.DataSource(dataSource => dataSource //Configure the Grid data source.
.Ajax() //Specify that Ajax binding is used.
.Read(read => read.Action("Kendo", "Home")
) //Set the action method which will return the data in JSON format.
)
.Columns(columns =>
{
//Create a column bound to the ProductID property.
columns.Bound(product => product.Id);
//Create a column bound to the ProductName property.
columns.Bound(product => product.FirstName);
//Create a column bound to the UnitsInStock property.
columns.Bound(product => product.LastName);
columns.Bound(product => product.EmailId);
columns.Bound(product => product.PhoneNumber);
})
.Pageable() // Enable paging
.Sortable() // Enable sorting
)
I have gone through official documentation it helped me to integrate Kendo ui with my Asp.net core Project. But i have no clue where i went wrong, its not binding the data with the grid.
I have been trying multiple ways but no use. Can anyone help me out to solve this issue.
Thanks in Advance.