0

I have kendo grid loading data from action

@(Html.Kendo().Grid<trwib_cct.Models.ViewModels.ApplicationUsersVM>()
.Name("Grid")
        .Columns(columns =>
        {
            columns.Bound(au => au.FirstName).Title("First Name").Width(200);
            columns.Bound(au => au.Roles).Title("CIP Code").Width(150);
            columns.Bound(au => au.StateID).Title("Status").Width(50);
            columns.Bound(au => au.StateName).Title("State").Width(50);
            columns.Bound(au => au.KeystoneID).Title("Keystone ID").Width(50);
            columns.Bound(au => au.IsWIAEligible).Title("Is WIA Eligible").Width(150);
            //columns.Bound(au => au.StateID).Visible(false);
            columns.Bound(au => au.ID).Visible(false);
        })
        .DataSource(dataSource => dataSource
            .Ajax()
               .Read(read => read.Action("datasource_read_Users", "dashboard", new { trainingProgramID = ViewBag.trainingProgramID }))
            )
        .Pageable(pager => pager
        .Refresh(true)
        .Messages(messages => messages.Empty("No Users Found")).PageSizes(true).ButtonCount(1))
    )

And the action is

 public ActionResult DataSource_Read_Users([DataSourceRequest] DataSourceRequest requestUsers, int trainingProgramID)
    {
        List<ApplicationUsersVM> results = LoadUsersGridData(trainingProgramID);
        DataSourceResult dsr = results.ToDataSourceResult(requestUsers);
        return Json(dsr);
    }

everything looks good and working but don't know why its not loading the data. even i did not get any error.

Thanks

7
  • Is your action method hit at all? You can test that with the debugger. May 8, 2013 at 7:44
  • @AtanasKorchev: Yes it hits all and returns records too. May 8, 2013 at 10:14
  • Then check if the required JavaScript files are included: docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/… May 8, 2013 at 10:49
  • Got the solution. It was my entity object fault. But kendoUI was not notifying the error not on java-script side too. so wierd. May 8, 2013 at 14:41
  • 2
    What do you mean your "entity object fault"? I think I might be having the same problem.
    – James
    May 9, 2013 at 15:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.