控制器
public List<Employee> Get()
{
var ramadrmasextsOL = from a in db.EmpMas
select new KendoApplication.Models.Employee
{
EmployeeName = a.EmpNm,
EPFNumber = a.EPFNo,
NameWithInitial = a.NameInInitials
};
return ramadrmasextsOL.ToList();
}
看法
<div id="employeesGrid"></div>
<script>
$(function () {
$("#employeesGrid").kendoGrid ({
columns: [
{ field: "EmployeeName", title: "Employee Name" },
{ field: "EPFNumber", title: "EPF Number" },
{ field: "NameWithInitial", title: "Name With Initial" }
],
pageable: true,
dataSource: new kendo.data.DataSource({
transport: {
read: "Home/Get"
}
})
});
});
</script>
员工模型
public class Employee
{
public string EmployeeName { get; set; }
public string EPFNumber { get; set; }
public string NameWithInitial { get; set; }
}
输出 -
请你帮我解决这个问题,我已经附上了这个问题的控制器、视图、模型,问题是表没有填充相关的数据库数据,这些数据只填充了空网格。