title: Kendo MVC Grid Within a Window DataSource Read
body: <p>I'm trying to populate a kendo grid within a kendo window in MVC and am unable to find what is wrong.  The window is created, and the grid is created within the window... however the DataSource's Read method is never called.</p>
  
  <p>Window:</p>
  
  <pre><code>@{    
  Html.Kendo().Window()
             .Name("DListing")
             .Title("Listing")
             .Draggable()
             .Resizable()
             .Width(1000)
             .Height(500)
             .Visible(true)
             .Modal(true)
             .Actions(actions =&gt; actions
                  .Maximize()
                  .Close())
             .LoadContentFrom("Dispatch", "Listing", new { Number = @ViewBag.Number })
             .Render();}
  </code></pre>
  
  <p>The Dispatch method in the Listing controller returns back a partial view that contains the grid.</p>
  
  <p>Grid:</p>
  
  <pre><code> @(Html.Kendo().Grid(Model)
          .Name("Grid")
          .Events(events =&gt; events.Change("onChange"))
          .HtmlAttributes(new { style = "height:400px;" })
          .Columns(columns =&gt;
          {
              columns.Bound(p =&gt; p.Number);
              columns.Bound(p =&gt; p.DateTime).Format("{0:MM/dd/yyyy hh:mm tt}");
              columns.Bound(p =&gt; p.Location);
              columns.Bound(p =&gt; p.Name);
              columns.Bound(p =&gt; p.Elapsed_Hours);
  
          })
          .Groupable()
          .Pageable(pageable =&gt; pageable
              .Numeric(false)
              .Input(true)
              .PageSizes(new[] { 5, 10, 25 }))
          .Sortable()
          .Scrollable(scrollable =&gt; scrollable
              .Virtual(true))
          .Filterable()
          .Selectable(selectable =&gt; selectable
              .Mode(GridSelectionMode.Multiple))
          .DataSource(dataSource =&gt; dataSource
              .Ajax()
              .PageSize(13)
              .Sort(sort =&gt; { sort.Add(p =&gt; p.DateTime).Descending(); })
              .Model(model =&gt; { model.Id(p =&gt; p.Number); })
              .Read(read =&gt; read.Action("Listing_Read", "Listing", new { Number = @ViewBag.Number })))
          )
  </code></pre>
  
  <p>Listing_Read Method:</p>
  
  <pre><code>    public ActionResult Listing_Read([DataSourceRequest] DataSourceRequest request, int Number)
      {
          return Json(GetListing(branchNumber).ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
      }
  </code></pre>
  
  <p>Also, it should be noted that I went through and verified that the viewbag data is available for both the window and later on in the grid.</p>
  
  <p>For a little more back info, I initially had the grid on it's own page and it was able to call the read method and populated with the data with no issues.  After moving it to populate in the window is when this became a problem.  </p>
  
  <p>Monitoring the http requests, the grid never attempts to call the read method (so the request isn't failing).  I tried manually refreshing the datasource after the window has loaded thinking that might force the call, but that doesn't call the read method either.</p>
  
  <p>I've been scratching my head on this one for a few hours now trying different things, hoping someone can spot what the problem is :)</p>