title: how to create custom kendo.ui.Window for edit in kendo.ui.grid
body: <p>I'm starter in kendo.Ui , i write this code for create grid</p>
  
  <pre><code>@(Html.Kendo().Grid&lt;BrandViewModel&gt;(Model)
      .Name("Grid")
      .Columns(columns =&gt;
      {
          columns.Bound(p =&gt; p.BrandName);
          columns.Bound(p =&gt; p.BrandAbbr);
          columns.Bound(p =&gt; p.SrcImage);
  
          columns.Command(command =&gt; command.Custom("Edit").Click("editItem"));
  
      })
  
      .DataSource(dataSource =&gt; dataSource
          .Ajax()
          .Read(read =&gt; read.Action("CustomCommand_Read", "Brand"))
           .Model(model =&gt; model.Id(p =&gt; p.Id))
  
                 )
  )
  </code></pre>
  
  <p>i want when user click in <code>Edit</code> button open <code>Edit view</code> in kendo window i write this code</p>
  
  <pre><code>@(Html.Kendo().Window().Name("Details")
      .Title("Customer Details")
      .Visible(false)
      .Modal(true)
      .Draggable(true)
  
      .Width(300)
  )
  
  
  
  &lt;script type="text/x-kendo-template" id="template"&gt;
      &lt;div id="details-container"&gt; &lt;!-- this will be the content of the popup --&gt;
          BrandName: &lt;input type='text' value='#= BrandName #' /&gt;
  
      &lt;/div&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>and java script code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var detailsTemplate = kendo.template($("#template").html());
  
      function editItem(e) {
          e.preventDefault();
  
          var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
  
          $("#Details").data("kendoWindow").refresh({
              url: "/Brand/Edit/" + dataItem.Id
          });
          $("#Details").data("kendoWindow").open();
  
  
  
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>this code work fine For the first time I click on a button,But when I click a second time.I encountered the following error</p>
  
  <pre><code>0x800a138f - JavaScript runtime error: Unable to get property 'refresh' of undefined or null reference
  </code></pre>
  
  <p>please help me, thanks all</p>