title: Refresh Kendo Grid after close of pop up window
body: <p>I'm using Kendo UI Web for asp.net mvc.  I generate a pop-up window via a grid command button.  After the closing of this pop-up window, I want the grid to be refreshed.  </p>
  
  <p>Close event on pop-up window:</p>
  
  <pre><code>function ClosingRateWindow(e) {
      var grid = $('#ContractDetailOrderEventGrid').data("kendoGrid");
      grid.dataSource.read();}
  </code></pre>
  
  <p>The grid is undefined at this time.</p>
  
  <p>Kendo Window definition:</p>
  
  <pre><code>@(Html.Kendo().Window()
      .Name("Rates")
      .Title("Rates")
      .Visible(false)
      .Modal(true)
      .Draggable(true)
      .Width(850)
      .Height(1200)
      .Events(x =&gt; x.Close("ClosingRateWindow"))
  )
  </code></pre>
  
  <p>Javascript to open window (a partial view is returned):</p>
  
  <pre><code>wnd.refresh({
      url: BASE_APP_URL + "ContractRateAdmin/OpenContractRate/",
      data: { data: data },
      traditional: true
  });
  wnd.center();
  wnd.open();
  </code></pre>
  
  <p>Grid Definition:</p>
  
  <pre><code>@(Html.Kendo().Grid&lt;TMS.MVC.TIMS.Models.Admin.Contract.ContractOrderEventGridModel&gt;()
  .Name("ContractDetailOrderEventGrid")
  .Columns(columns =&gt;
  {
      columns.Command(o =&gt;
      {
          o.Destroy();
          o.Edit();
      }).Width(100).Title("Commands");
  
      columns.Command(command =&gt; 
          { 
              command.Custom("Rates").Click("ShowRates");
          }).Title("Rates").Width(120);
      columns.Bound(o =&gt; o.ContractId).Hidden(true);
      columns.Bound(o =&gt; o.OrderTypeId).Hidden(true);
      //columns.Bound(o =&gt; o.ActiveRateMissing).Width(70).Title("Missing Rates?");
      columns.Bound(o =&gt; o.OrderLevelFlag).Width(50).Title("Order Level").EditorTemplateName("ContractOE_OrderLevelFlag");
      columns.Bound(o =&gt; o.Active).Width(80).Title("Active").EditorTemplateName("ContractOE_Active");
      columns.Bound(o =&gt; o.InvoiceDescription).Width(150).Title("Invoice Desc");
      columns.Bound(o =&gt; o.SourceContainerOwnerNameDisplay).Width(150).Title("Src Cont Owner").EditorTemplateName("ContractOE_SourceContainerOwner");
      columns.Bound(o =&gt; o.DestContainerOwnerNameDisplay).Width(150).Title("Dest Cont Owner").EditorTemplateName("ContractOE_DestContainerOwner");
      columns.Bound(o =&gt; o.SourceContainerTypeName).Width(150).Title("Src Cont Type").EditorTemplateName("ContractOE_SourceContainerTypeName");
      columns.Bound(o =&gt; o.DestContainerTypeName).Width(150).Title("Dest Cont Type").EditorTemplateName("ContractOE_DestContainerTypeName");
      columns.Bound(o =&gt; o.SourceContainerName).Width(150).Title("Src Container").EditorTemplateName("ContractOE_SourceContainerName");
      columns.Bound(o =&gt; o.DestContainerName).Width(150).Title("Dest Container").EditorTemplateName("ContractOE_DestContainerName");
      columns.Bound(o =&gt; o.EventAliasName).Width(150).Title("Event").EditorTemplateName("ContractOE_EventAliasName");
      columns.Bound(o =&gt; o.ProductName).Width(150).Title("Product").EditorTemplateName("ContractOE_ProductName");
      columns.Bound(o =&gt; o.OrderByNameDisplay).Width(150).Title("Order By").EditorTemplateName("ContractOE_OrderBy");
      columns.Bound(o =&gt; o.OrderTypeName).Width(150).Title("Order Type").EditorTemplateName("ContractOE_OrderTypeName");
      columns.Bound(o =&gt; o.EmployeeDisplay).Width(150).Title("Employee").EditorTemplateName("ContractOE_EmployeeDisplay");
      columns.Bound(o =&gt; o.CarrierName).Width(150).Title("Carrier").EditorTemplateName("ContractOE_CarrierName");
  })
      .Events(e =&gt; e
          .Save("Contract_Save")
          //.Remove("ContractOrderEventGrid_Remove")
          .DataBound("Contract_DataBound"))
      .Scrollable(scrolling =&gt; scrolling.Enabled(true).Height("300px"))
      .ToolBar(toolbar =&gt;  {
              if (Model.DetailModel.ContractAdminDetailPermissionModel.AddOrderEvent_Button_Visible == true)
                  toolbar.Create().Text("Add");
      })
      .HtmlAttributes(new { style = "width: 1200px" })
      .Editable(editable =&gt; editable.Mode(GridEditMode.InLine))
      .Sortable(sorting =&gt; sorting.Enabled(true))
      .Pageable(paging =&gt; paging.Enabled(false))
      .Resizable(resizing =&gt; resizing.Columns(true))
      .Filterable(filtering =&gt; filtering.Enabled(true))
      .Groupable(grouping =&gt; grouping.Enabled(true))
      .DataSource(dataSource =&gt; dataSource
          .Ajax()
          .Model(model =&gt;
          {
              model.Id(p =&gt; p.ContractOrderEventId);
              model.Field(x =&gt; x.ActiveRateMissing).Editable(false);
              model.Field(x =&gt; x.ContractId).Editable(false);
              model.Field(x =&gt; x.OrderTypeId).Editable(false);
              model.Field(x =&gt; x.Active).Editable(true).DefaultValue("Y");
              model.Field(x =&gt; x.OrderLevelFlag).Editable(true).DefaultValue("N");
              model.Field(x =&gt; x.InvoiceDescription).Editable(true).DefaultValue("Enter Invoice Description");
              model.Field(x =&gt; x.SourceContainerOwnerNameDisplay).Editable(true).DefaultValue("ALL");
              model.Field(x =&gt; x.DestContainerOwnerNameDisplay).Editable(true).DefaultValue("ALL");
              model.Field(x =&gt; x.SourceContainerTypeName).Editable(true).DefaultValue("ALL");
              model.Field(x =&gt; x.DestContainerTypeName).Editable(true).DefaultValue("ALL");
              model.Field(x =&gt; x.SourceContainerName).Editable(true).DefaultValue("ALL");
              model.Field(x =&gt; x.DestContainerName).Editable(true).DefaultValue("ALL");
              model.Field(x =&gt; x.EventAliasName).Editable(true).DefaultValue("ALL");
              model.Field(x =&gt; x.ProductName).Editable(true).DefaultValue("ALL");
              model.Field(x =&gt; x.OrderByNameDisplay).Editable(true).DefaultValue("ALL");
              model.Field(x =&gt; x.OrderTypeName).Editable(true).DefaultValue("ALL");
              model.Field(x =&gt; x.EmployeeDisplay).Editable(true).DefaultValue("ALL");
              model.Field(x =&gt; x.CarrierName).Editable(true).DefaultValue("ALL");
          })
             .Events(x =&gt;
             {
                // x.RequestEnd("RefreshContractDetailOrderEventGrid");
                 //x.Error("ContractDetailOrderEventGrid_Error");
             })
         .Create(update =&gt; update.Action("CreateContractOrderEvent", "ContractGrid", new { selectedContractId = Model.DetailModel.ContractId }))
         .Read(read =&gt; read.Action("ReadContractOrderEvent", "ContractGrid", new { contractId = Model.DetailModel.ContractId }))
         .Update(update =&gt; update.Action("UpdateContractOrderEvent", "ContractGrid", new { contractId = Model.DetailModel.ContractId }))
         .Destroy(update =&gt; update.Action("DestroyContractOrderEvent", "ContractGrid"))
      ))
  </code></pre>
  
  <p>Any ideas on how to do this?</p>