Kendo MVC Grid paging buttons not changing results displayed
<p>I have a Kendo Grid. The paging numbers are ok, items per page is ok, but when I press on page number the results in grid isn't changing, all results are shown in first page. Please help here.</p>
<p>Below is my code:</p>
<pre class="lang-js prettyprint-override"><code>&lt;script&gt;
    $(function() {
        $(&quot;#invoices-grid&quot;).kendoGrid({
            dataSource: {
                data: @Html.Raw(JsonConvert.SerializeObject(Model.Invoices)),
                schema: {
                    model: {
                        fields: {
                            JobNumber: { type: &quot;string&quot; },
                            CustomerName: { type: &quot;string&quot; },
                            DepartmentName: { type: &quot;string&quot; },
                            DateInvoice: { type: &quot;string&quot; },
                            ValidDays: { type: &quot;number&quot; },
                            Delivery: { type: &quot;string&quot; },
                            IsPayed: { type: &quot;boolean&quot; },
                            Payed: { type: &quot;number&quot; },
                            Status: { type: &quot;boolean&quot; },
                        }
                    }
                },
                @*type: &quot;json&quot;,
                transport: {
                    read: {
                        url: &quot;@Html.Raw(Url.Action(&quot;List&quot;, &quot;Finances&quot;))&quot;,
                        type: &quot;POST&quot;,
                        dataType: &quot;json&quot;,
                        data: additionalData1
                    },
                },
                schema: {
                    data: &quot;Data&quot;,
                    total: &quot;Total&quot;,
                    errors: &quot;Errors&quot;
                },*@
                error: function(e) {
                    display_kendoui_grid_error(e);
                    // Cancel the changes
                    this.cancelChanges();
                },
                pageSize: 20,
                serverPaging: true,
                serverFiltering: true,
                serverSorting: true
            },
          
            columns: [
                {
                    field: &quot;JobNumber&quot;,
                    title: &quot;@T(&quot;gp.Invoice.Fields.JobNumber&quot;)&quot;,
                    template: '#= JobNumber #'
                },
                {
                    field: &quot;CustomerName&quot;,
                    title: &quot;@T(&quot;gp.Invoice.Fields.CustomerName&quot;)&quot;,
                    template: '#= CustomerName #'
                },
                {
                    field: &quot;DepartmentName&quot;,
                    title: &quot;@T(&quot;gp.Invoice.Fields.DepartmentName&quot;)&quot;,
                    template: '#= DepartmentName #'
                },
                {
                    field: &quot;DateInvoice&quot;,
                    title: &quot;@T(&quot;gp.Invoice.Fields.DateInvoice&quot;)&quot;,
                    template: '#= DateInvoice #'
                },
                {
                    field: &quot;ValidDays&quot;,
                    title: &quot;@T(&quot;gp.Invoice.Fields.ValidDays&quot;)&quot;,
                    template: '#= ValidDays #'
                },
                {
                    field: &quot;Delivery&quot;,
                    title: &quot;@T(&quot;gp.Invoice.Fields.Delivery&quot;)&quot;,
                    template: '#= Delivery #'
                },
                {
                    field: &quot;Payed&quot;,
                    title: &quot;@T(&quot;gp.Invoice.Fields.IsPayed&quot;)&quot;,
                    template: '#= (Payed == 2) ? &quot;Комп.&quot; : ((Payed == 1) ? &quot;ДЕ&quot; : &quot;НЕ&quot;) #'
                },
                {
                    field: &quot;Id&quot;,
                    title: &quot;@T(&quot;Common.Edit&quot;)&quot;,
                    width: 100,
                    template: '&lt;a href=&quot;Edit/#=Id#&quot;&gt;@T(&quot;Common.Edit&quot;)&lt;/a&gt;'
                },
            ],
            pageable: {
                refresh: true,
                pageSizes: [5, 10, 20, 50]
            },
            editable: {
                confirmation: false,
                mode: &quot;popup&quot;
            },
            scrollable: false,
           
            selectable: true,
            change: function(e) {
                var selectedRows = this.select();

                var jobId = parseInt($(selectedRows).data('job-id'));
                var jobItemId = parseInt($(selectedRows).data('job-item-id'));

                var result = $.get(&quot;@Url.Action(&quot;SideDetails&quot;, &quot;Production&quot;)/&quot; + jobItemId);

                result.done(function(data) {

                    if (data) {
                        $(&quot;.job-edit .jobItemDetails&quot;).html(data);
                    }

                });
             
            },
           
            rowTemplate: kendo.template($(&quot;#invoiceRowTemplate&quot;).html()),
        });
    });
&lt;/script&gt;
</code></pre>
<pre class="lang-csharp prettyprint-override"><code>protected virtual void PrepareInvoiceFinanceListModel(FinanceListModel model,FormCollection form/*,string SearchJobItemNumber*/)
{
    var customers = model.SearchCustomerId;
    var isChecked = model.IsChecked;
    var searchString = model.SearchJobItemNumber;
    var IsChecked1 = model.IsChecked1;
    // searchString = model.SearchJobItemNumber;/* &quot;001/2016&quot;;*/
    //var searchString = model.SearchJobItemNumber;
    //searchString = &quot;091/2016&quot;;
    
    if (model == null)
        throw new ArgumentNullException(&quot;model&quot;);

    var finishedJobs = _jobService.GetJobsByHasInvoice(false);

    finishedJobs = finishedJobs.OrderByDescending(x =&gt;
        {
            var firstOrDefault = x.JobItems.FirstOrDefault();
            return firstOrDefault?.DateCompletition ?? new DateTime();
        }).ToList();

    foreach (var job in finishedJobs)
    {
        var jobModel = job.ToModel();
        model.FinishedJobs.Add(jobModel);
    }

    var jobsBycustomers = finishedJobs.GroupBy(x =&gt; new { x.CustomerId, x.Customer.Name }).Select(x =&gt; new JobCustomersModel()
    {
        CustomerId = x.Key.CustomerId,
        CustomerName = x.Key.Name,
        JobsCount = x.Count(),
    });

    model.FinishedJobStatus = new JobStatusesModel()
    {
        Status = _localizationService.GetResource(&quot;gp.jobs.whitout.invoice&quot;),
        Value = (int)JobStatusEnum.Finished,
        Count = finishedJobs.Count,
        CustomersJobs = jobsBycustomers.ToList()
    };

    var invoices = _invoiceService.GetAllInvoices(searchString, isChecked, IsChecked1, customers);
    foreach (var invoice in invoices)
    {
        var inv = invoice.ToModel();
        // var a = invoice.Payed;
        model.Invoices.Add(inv);
    }
    
    /////////////////////             ////////////////////////
    //var allCustomers = _invoiceService.GetAllCustomers(customers);
    //foreach (var customer in allCustomers)
    //{
    //    var cust = customer.ToModel();
    //    model.SearchCustomerId = customer.CustomerId;
    //    model.Invoices.Add(cust);
    //}

    var invoiceByCustomer = invoices
        .GroupBy(x =&gt; new { x.CustomerId, x.CustomerName })
        .Select(x =&gt; new JobCustomersModel()
        {
            CustomerId = x.Key.CustomerId,
            CustomerName = x.Key.CustomerName,
            JobsCount = x.Count(),
        });

    model.InvoiceStatus = new JobStatusesModel()
    {
        Status = _localizationService.GetResource(&quot;gp.jobs.with.invoice&quot;),
        Value = (int)JobStatusEnum.Finished,
        Count = invoices.Count,
        CustomersJobs = invoiceByCustomer.ToList()
    };

    var latestOffers = _offerService.GetLatestOffers(0, 10);
    foreach (var offer in latestOffers)
    {
        var offerModel = offer.ToModel();
        model.LatestOffers.Add(offerModel);
    }
}
</code></pre>