Kendo Grid DataSource Not calling the action on page load

2 posts, 0 answers
  1. Natarajan
    Natarajan avatar
    1 posts
    Member since:
    Jan 2018

    Posted 06 Feb 2018 Link to this post

    below is the kendo grid which is not calling the mentioned action/controller on page load hence the data to the grid is empty..

    HTML Code

    <div class="container-fluid">
            <div class="row">
                <div class="col-xs-18 col-md-12">
                .Columns(columns =>
                    columns.Bound(p => p.UserName).Filterable(false);
                    columns.Bound(p => p.UserRole);
                    columns.Bound(p => p.Email);
                    columns.Bound(p => p.isLocked);
                .HtmlAttributes(new { style = "height:550px;" })
                .DataSource(dataSource => dataSource
                .Read(read => read.Action("Orders_Read", "Admin"))




    public ActionResult Orders_Read([DataSourceRequest]DataSourceRequest request)
                Model user = new Model();
                foreach (var a in DbContext.Users)
                    user.UserName = a.Name;
                    user.UserRole = Roles.ToString();
                    user.isLocked = a.Lockout;
                    user.Email = a.mail;
                var result = Enumerable.Range(0, 10).Select(i => new Model
                    UserName = user.UserName,
                    Email = user.Email,
                    isLocked = user.isLocked,
                    UserRole = user.UserRole
                return Json(result.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);

  2. Stefan
    Stefan avatar
    2082 posts

    Posted 08 Feb 2018 Link to this post

    Hello, Natarajan,

    Thank you for the provided code.

    After inspecting it all looks good. The only thing that may be causing the issue is that the Controller is not called AdminController.

    When the page is loaded the Grid should make a request and I can suggest inspecting in the network tab the URL to which the request is made. If there are no requests made inside the network tab, please provide an example as the issue could be caused by a factor which we are overlooking at this moment.

    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top