Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Finally got answer:</p> <p>View:</p> <pre><code>@(Html.Kendo().Grid&lt;KendoUI.Models.EmployeeViewModel&gt;() .Name("Grid") .Columns(columns =&gt; { columns.Bound(p =&gt; p.name).Title("Name"); columns.Bound(p =&gt; p.gender).Title("Gender"); columns.Bound(p =&gt; p.designation).Title("Designation").Width("300px"); columns.Bound(p =&gt; p.department).Title("Department").Width("300px"); }) .Editable(editable =&gt; editable.Mode(GridEditMode.InLine)) .Navigatable() .Pageable() .Sortable() .Scrollable() .DataSource(dataSource =&gt; dataSource // Configure the grid data source .Ajax() .Model(model =&gt; { model.Id(x =&gt; x.id); }) .Read(read =&gt; read.Action("Employee_Read", "Home")) // Set the action method which will return the data in JSON format ) ) </code></pre> <p>Controller:</p> <pre><code> public ActionResult Employee_Read([DataSourceRequest]DataSourceRequest request) { IQueryable&lt;Bhupendra_employees&gt; Details = _dbContext.Bhupendra_employees; DataSourceResult result = Details.ToDataSourceResult(request, p =&gt; new EmployeeViewModel { id = p.id, name = p.name, gender = p.gender, designation = p.designation, department = p.Bhupendra_Dept.Dept_Description }); return Json(result, JsonRequestBehavior.AllowGet); } </code></pre> <p>Model:</p> <pre><code>public class EmployeeViewModel { public Int32 id { get; set; } public String name { get; set; } public String gender { get; set; } public String designation { get; set; } public String department { get; set; } //public DateTime dob { get; set; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload