title: Kendo Grid Field value set by another grid select
body: <p>this is the main grid, i am trying to update main grid fields with popup grid selection. please help me.this code will update the main grid by selection of popup. but not set model. so i ddnt get value on controller. how do i solve this issue?</p>
  
  <pre><code>&lt;a id="window"&gt;&lt;/a&gt;
   @(Html.Kendo().Grid&lt;IBATechnologies.IBA.Web.Models.AssetLocationViewModel&gt;()
          .Name("GridLocation")
         .Columns(columns =&gt;
  {
      //columns.Bound(p =&gt; p.UserId).Width(125);
      columns.Bound(p =&gt; p.CampanyCode).Width(125);
      columns.Bound(p =&gt; p.location1code).Width(165).Filterable(false);
      columns.Bound(p =&gt; p.location2code).Width(150).Filterable(false);
      columns.Bound(p =&gt; p.locationCode).Width(125);
      columns.Bound(p =&gt; p.Name).Width(150);
      columns.Bound(p =&gt; p.ShortName).Width(150);
      columns.Bound(p =&gt; p.CreatedBy).Width(150);
      columns.Bound(p =&gt; p.ModifyBy).Width(150);
  
  
      //columns.Bound(p =&gt; p.Designation).Width(150);
      columns.Command(command =&gt; { command.Edit(); command.Destroy(); }).Width(200);
  })
  .ToolBar(toolbar =&gt; toolbar.Create())
  .Editable(editable =&gt; editable.Mode(GridEditMode.InCell))
  .Pageable()
  
  .Sortable()
  .Scrollable()
  .Selectable()
  .Filterable(filterable =&gt; filterable
      .Extra(false)
      .Operators(operators =&gt; operators
          .ForString(str =&gt; str.Clear()
              .StartsWith("Starts with")
              .IsEqualTo("Is equal to")
              .IsNotEqualTo("Is not equal to")
          )))
  .HtmlAttributes(new { style = "height:430px;" })
  .DataSource(dataSource =&gt; dataSource
      .Ajax()
      .PageSize(20)
  
      //.Events(events =&gt; events.Error("error_handler"))
      .Model(model =&gt; model.Id(p =&gt; p.locationCode))
      .Create(update =&gt; update.Action("AssetLocEditingPopup_Create", "Location"))
          .Read(read =&gt; read.Action("AssetLocationEditingPopup_Read", "Location"))
          .Update(update =&gt; update.Action("AssetLocEditingPopup_Update", "Location"))
  
          .Destroy(update =&gt; update.Action("AssetLocEditingPopup_Destroy", "Location"))
  )
  
  
  
  
  )
  
  
  
     &lt;script type="text/javascript"&gt;
  
  
      $(document).ready(function () {
      $("#GridLocation").on("dblclick", " tbody &gt; tr &gt; td", function () {
  
          //model.location2code = 100;
          //var grid = $("#GridLocation").data("kendoGrid");
          //var data = grid.datasource.at(0);
          ////data.set("location1code", l1locode);
          //alert(data.location1code);
          //var gridDataArray = $('#GridLocation').data('kendoGrid')._data;
          //var columnDataVector = [];
          //var columnName = 'location1code';
          ////for (var index = 0; index &lt; gridDataArray.length; index++) {
          ////    columnDataVector[index] = gridDataArray[index][columnName];
          ////};
          ////alert(columnDataVector[0]);
          //gridDataArray[0].text("location1code", "frfrf");
          //$("#locapopupWindow").data('kendoWindow').open();
          $("#window").load("@Url.Action("PopupWindow", "Location")");
          //$(this).load("/Shared/_assetLocationPopup");
  
  
          $('#GridLocation').data('kendoGrid').refresh()
          //firstItem.dirty = true;  // set it as dirty
  
          //$('#GridLocation').data().kendoGrid.dataSource.sync();
      });
  
  });
  </code></pre>
  
  <p></p>
  
  <p>this is popup window with grid</p>
  
  <pre><code> @{Html.Kendo().Window()
  .Name("locapopupWindow")
  .Title("Select Location")
  .Draggable()
  .Width(500)
  .Height(300)
  .Actions(actions =&gt; actions
  .Custom("custom")
  .Minimize()
  .Maximize()
  .Close()
  
  )
  .Content(@&lt;text&gt;
  
    @{Html.Kendo().Grid&lt;IBATechnologies.IBA.Web.Models.AssetLocationViewModel&gt;()
  .Name("locationpopupGrid")
  
         .Columns(columns =&gt;
         {
             columns.Bound(p =&gt; p.CampanyCode).Width(125).Visible(false);
             columns.Bound(p =&gt; p.location1code).Width(165).Visible(false);
             columns.Bound(p =&gt; p.location2code).Width(150).Visible(false);
             columns.Bound(p =&gt; p.Name).Width(150);
             columns.Bound(p =&gt; p.ShortName).Width(150);
             columns.Bound(p =&gt; p.CreatedBy).Width(150).Visible(false);
             columns.Bound(p =&gt; p.ModifyBy).Width(150).Visible(false);
  
         })
  .Pageable()
  .Sortable()
  .Scrollable()
  
  .Selectable()
  
  .Filterable(filterable =&gt; filterable
      .Extra(false)
      .Operators(operators =&gt; operators
          .ForString(str =&gt; str.Clear()
              .StartsWith("Starts with")
              .IsEqualTo("Is equal to")
              .IsNotEqualTo("Is not equal to")
          )))
  .HtmlAttributes(new { style = "height:250px;" })
  
  .DataSource(dataSource =&gt; dataSource
      .Ajax()
      .PageSize(10)
  
      //.Events(events =&gt; events.Error("error_handler"))
      .Model(model =&gt; model.Id(p =&gt; p.location1code))
  
      .Create(update =&gt; update.Action("Level2LocEditingPopup_Create", "Asset"))
          .Read(read =&gt; read.Action("Level2LocationEditingPopup_Read", "Location"))
  
  
  )
  
  .Render();
  
  }
  </code></pre>
  
  <p>
      )</p>
  
  <pre><code>   .Render();
  
  
     }
  
  $(document).ready(function (){
  
      $("#locationpopupGrid").data("kendoGrid").bind("change", enter code hereonLocationRowSelected);
      $("#locapopupWindow").data("kendoWindow").bind("close", onWindowClose);
  
      function onLocationRowSelected()
      {
          var grid = $("#locationpopupGrid").data("kendoGrid");
          var selectedItem = grid.dataItem(grid.select());
  
          orisfunction(selectedItem.location1code, enter code hereselectedItem.location2code);
  
          $("#locapopupWindow").data("kendoWindow").close();
          $("#locapopupWindow").data("kendoWindow").destroy();
  
      }
      function orisfunction(l1locode, l2locode)
      {
  
          var grid = $("#GridLocation").data("kendoGrid");
          var data = grid.dataSource.data()[0];
  
          // Here I am trying to update grid, here data is shows in grid cell but not update model so i cant get value at controlller
          data.set("location1code", l1locode); 
          data.set("location2code", l2locode);
      }
      function onWindowClose()
      {
          $("#locapopupWindow").data("kendoWindow").destroy();
      }
  });
  </code></pre>
  
  <p>please help me</p>