Can't get Server-Side Paging to work with AJAX Binding

3 posts, 1 answers
  1. Chris
    Chris avatar
    8 posts
    Member since:
    Jul 2015

    Posted 03 Oct Link to this post

    I am attempting to enable server-side filtering for my ASP.NET MVC Grid. I have tried every tutorial, walkthrough, and blog post I could find, but with no success.

    I would like to, on page load, call out to my data source and return just the first 25 records, but alert the grid of the total record count so that it can display the appropriate number of pages. Here is my Grid Razor code:

    @(Html.Kendo().Grid<ViewModel>().Name("MyGrid").EnableCustomBinding(true).Columns(columns =>
        columns.Bound(c => c.FieldA);
        columns.Bound(c => c.FieldB);
        columns.Bound(c => c.FieldC);
        columns.Bound(c => c.FieldD);
      }).ClientDetailTemplateId("DetailsTemplate").HtmlAttributes(new {@class = "myClass"}).DataSource(dataSource => dataSource
          .Read(read => read
            .Action("Data_Read", "MyController"))
        ).AutoBind(false).Events(events =>

    This was done by following this article:

    I have tried many variations of this, including removing AutoBind(). As far as I can tell, part of my issue is that I am not defining what the PageSizes are; whenever I set the PageSizes value I get an error of "Uncaught TypeError: r._query is not a function".

    No matter what I try, the page count is always 0.

    From the server-side, I am using the PageSize and Page number from the DataSourceRequest object to pass in as parameters to my data source. I am then returning the following:

    var result = new DataSourceResult
        Data = myData,
        Total = 300 // this is dynamic, just hardcoded here as an example
    return Json(result);

    Can someone please assist?

    Thank you.

  2. Chris
    Chris avatar
    8 posts
    Member since:
    Jul 2015

    Posted 04 Oct in reply to Chris Link to this post

    I have attached an image showing what my pager display always looks like.


  3. UI for ASP.NET AJAX banner
  4. Answer
    Kostadin avatar
    1687 posts

    Posted 05 Oct Link to this post

    Hello Chris,

    I already answered the support ticket with the same requirement. I would appreciate if we continue our conversation in it.

    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top