title: Get record count in Kendo Grid after dataSource.read
body: <p>I want to be able to push the record count from my Kendo grid after read (refresh).</p>
  
  <p><strong>Here is my Kendo Grid:</strong></p>
  
  <pre><code>    @(Html.Kendo().Grid(Model)
        .Name("SearchWindowGrid")
        .Columns(columns =&gt;
            {
                columns.Bound(p =&gt; p.SYSTEM_ITEMS_SEGMENT1).Hidden();
            })
        .ClientRowTemplate(
            "&lt;tr&gt;" +
              "&lt;td&gt;" +
                  "&lt;span&gt;&lt;b&gt;#: SYSTEM_ITEMS_SEGMENT1#&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;br/&gt;" +
                  "&lt;span&gt;#: DESCRIPTION# &lt;/span&gt;" +
              "&lt;/td&gt;" +
            "&lt;/tr&gt;"
        )
        .DataSource(dataSource =&gt; dataSource
          .Ajax()
          .Read(read =&gt; read.Action("PopulateSearchWindow", "Item").Data("additionalSearchWindowInfo"))
          .Events(ev =&gt; ev.Error("onErrorSearchWindow"))
        )
        .Selectable(s =&gt; s.Enabled(true).Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
        .Scrollable(s =&gt; s.Enabled(true).Height(450))
    )
  </code></pre>
  
  <p><strong>My Controller action:</strong></p>
  
  <pre><code>    public ActionResult PopulateSearchWindow([DataSourceRequest] DataSourceRequest request, string option, string searchText, string searchDesc)
      {
          try
          {
              var derps= _idg.SearchItems(searchText, searchDesc, _adg.OrganizationCode).ToList();
  
              return Json(derps.ToDataSourceResult(request, ModelState));
          }
          catch (Exception e)
          {
              ModelState.AddModelError("ExceptionErrors", e.Message);
              return Json(new List&lt;Derp&gt;().ToDataSourceResult(request, ModelState));
          }
      }
  </code></pre>
  
  <p><strong>Here is my function that forces data refresh:</strong></p>
  
  <pre><code>    function refreshData(){
          $("#SearchWindowGrid").data("kendoGrid").dataSource.read();
          //TODO: get the total count and push to #countElement
          var count = $("#SearchWindowGrid").data("kendoGrid").length; //not sure what to do here
          $("#countElement").val(count);
      }
  </code></pre>
  
  <p>Where I put my TODO in the jQuery function I want to be able to get the number of rows and push that number into a specific elemnt on my page.</p>