title: How to attach databound event of kendo Grid in document ready function?
body: <p>I have a MVC Kendo UI grid and im trying to attach dataBound event. Below are the two approaches  I was trying to use. I would preferred 1st approach if I can</p>
  
  <pre><code>@(Html.Kendo().Grid&lt;BatchDetails&gt;()
      .Name("Grid")
      .Columns(col =&gt;
      {
          col.Bound(p =&gt; p.BatchKey).Title("State");
          col.Bound(p =&gt; p.OriginalCost).Title("Total Cost");
       })
          .AutoBind(true)
          .DataSource(dataSource =&gt; dataSource
              .Ajax()
              .PageSize(20)                    
              .Read(read =&gt; read
                  .Action("GetData", "Home", new { batchID = Model.BatchID })))
  </code></pre>
  
  <p>)</p>
  
  <p><strong>1></strong> I want to bind DataBound event of the grid in document ready function. 
    but when i do that i get null reference</p>
  
  <pre><code>$function({
       var grid = $("#Grid").data("kendoGrid"); // grid variable is null here
       grid.bind("dataBound", function(){
       //dosomething here
   }); 
  </code></pre>
  
  <p>})</p>
  
  <p><strong>2></strong> If i bind the event using the following approach then i have to declare the onDataGridBound function as Global. The Grid cannot access scoped function</p>
  
  <pre><code> @(Html.Kendo().Grid&lt;BatchDetails&gt;()
        .Name("Grid")
        .Events(x =&gt; x.DataBound("onDataGridBound"))
    ) 
  </code></pre>
  
  <p>is there any way to declare onDataGridBound as scoped function, and grid can still access it?</p>