title: Bind results from search
body: <p>I cannot bind results from search in kendo grid. I've tried many times, I'm in trouble four days, I don't know what is wrong here,</p>
  
  <p>When i debug action everything is working perfect,data is OK, return grid result are OK, but results aren't shown in kendo.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;script&gt;
  
    $(function() {
  
      $("a.k-button").on('click', function (e) {
  
        debugger;
        e.preventDefault();
  
        var dataObj = serializeByFieldsWrap(".invoiceForm");
        var dataUrl = $(this).data('url');
  
        // dataObj.ToolboxId = toolboxId;
  
        $('body').css('cursor', 'wait');
  
        var result = $.ajax({
          type: "POST",
          url: dataUrl,
          dataType: 'json',
          data: dataObj,
          //complete:  $("#invoices-grid").data("kendoGrid").data.read(),
  
        });
  
        result.done(function (data) {
          console.log(data);
  
          var grid = $('#invoices-grid').data("kendoGrid");
          grid.dataSource.data(data);
        });
  
        result.fail(function (error) {
          console.log(error);
        });
  
      });
  
    });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public ActionResult List(DataSourceRequest command, FinanceListModel model)
  {
    var searchString = model.SearchJobItemNumber;
    var isChecked = model.IsChecked;
    var invoices = _invoiceService.GetAllInvoices(searchString, isChecked);
  
    var gridModel = new DataSourceResult
    {
      Data = invoices.Select(x =&gt; {
        var jobModel = x.ToModel();
        return jobModel;
      }),
      Total = invoices.TotalCount
    };
  
    return Json(gridModel, "application/json", JsonRequestBehavior.AllowGet);
  }
  </code></pre>
  
  <p>Kendo UI Grid:</p>
  
  <pre><code>&lt;script&gt;
  
    $(function() {
      $("#invoices-grid").kendoGrid({
  
        dataSource: {
          data: @Html.Raw(JsonConvert.SerializeObject(Model.Invoices)),
          schema: {
            model: {
              fields: {
                JobNumber: { type: "string" },
                CustomerName: { type: "string" },
                DepartmentName: { type: "string" },
                DateInvoice: { type: "string" },
                ValidDays: { type: "number" },
                Delivery: { type: "string" },
                IsPayed: { type: "boolean" },
                Payed: { type: "number" },
                Status: { type: "boolean" },
              },
              error: function(e) {
                display_kendoui_grid_error(e);
                // Cancel the changes
                this.cancelChanges();
              },
              pageSize: 20,
              serverPaging: true,
              serverFiltering: true,
              serverSorting: true
            },
            dataBound: function () {
              var row = this.element.find('tbody tr:first');
              this.select(row);
            },
  
            columns: [
              @*{
                field: "Status",
                title: "@T("gp.Jobs.Fields.Status")",
                template: '#= Status #'
              },*@
               {
                 field: "JobNumber",
                 title: "@T("gp.Invoice.Fields.JobNumber")",
                 template: '#= JobNumber #'
               },
               {
                 field: "CustomerName",
                 title: "@T("gp.Invoice.Fields.CustomerName")",
                 template: '#= CustomerName #'
               },
               {
                 field: "DepartmentName",
                 title: "@T("gp.Invoice.Fields.DepartmentName")",
                 template: '#= DepartmentName #'
               },
               {
                 field: "DateInvoice",
                 title: "@T("gp.Invoice.Fields.DateInvoice")",
                 template: '#= DateInvoice #'
               },
               {
                 field: "ValidDays",
                 title: "@T("gp.Invoice.Fields.ValidDays")",
                 template: '#= ValidDays #'
               },
               {
                 field: "Delivery",
                 title: "@T("gp.Invoice.Fields.Delivery")",
                 template: '#= Delivery #'
               },
               {
                 field: "Payed",
                 title: "@T("gp.Invoice.Fields.IsPayed")",
                 template: '#= (Payed == 2) ? "Комп." : ((Payed == 1) ? "ДЕ" : "НЕ") #'
               },
               {
                 field: "Id",
                 title: "@T("Common.Edit")",
                 width: 100,
                 template: '&lt;a href="Edit/#=Id#"&gt;@T("Common.Edit")&lt;/a&gt;'
               }
              ],
              pageable: {
              refresh: true,
              pageSizes: [5, 10, 20, 50]
          },
          editable: {
            confirmation: false,
            mode: "popup"
          },
          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("@Url.Action("SideDetails", "Production")/" + jobItemId);
  
            result.done(function(data) {
  
              if (data) {
                $(".job-edit .jobItemDetails").html(data);
              }
  
            });
  
          },
  
          rowTemplate: kendo.template($("#invoiceRowTemplate").html()),
  
        });
      });
  
  &lt;/script&gt;
  </code></pre>