KendoGrid Server side paging

2 posts, 0 answers
  1. MUDIAM
    MUDIAM avatar
    2 posts
    Member since:
    Sep 2020

    Posted 09 Dec 2020 Link to this post

    Hi,

    We have recently changed some legacy code which was calling a WCF API to populate the grid and it was using serverside paging. We have to use the same serverside paging but with C# datasource. How can we achieve this?

    This is how the code was before when it used an API:
    dataSource: {
        type: "odata",
        transport: {
            read: dataUrl,
            dataType: "json"
        },
        schema: {
            model: BillingModel,
            data: function (data) {
                return data["value"];
            },
            total: function (data) { return data['odata.count']; }
        },
        serverPaging: true,
        serverFiltering: true,
        serverSorting: true,
        sort: { field: "EncounterDate", dir: "asc" }
    }

    This was changed to use the c# datasource now:

    dataSource: {
        schema: {
            model: BillingModel,
        }
    }

  2. Anton Mironov
    Admin
    Anton Mironov avatar
    207 posts

    Posted 11 Dec 2020 Link to this post

    Hello Mudiam,

    Thank you for the provided code snippet.

    In order to achieve the desired behavior, I would recommend using the following demo as a template. It represents the Custom Ajax binding of a DataSource:

    Open the View Source tab and find the implementation of the "ApplyOrdersPaging" Method in the "CustomAjaxBindingController". Pass and use the "page" and "pageSize" parameters for "Skip" and "Take" methods. This is the recommended way to implement the Server-side paging.

    Give the approach above a try and let me know if further assistance is needed.

    Kind Regards,
    Anton Mironov
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Back to Top