title: Kendo Grid.dataItem loop not working
body: <p>So my aim it to loop through all selected item in my kendo grid, but after the first iteration the dataItem method returns undefined.</p>
  
  <pre><code>function myFunction() {
  var selectedItem = $("#DropDown").val();
  var grid = $("#Grid").getKendoGrid();
  var selectedItems = grid.select();
  for (var i = 0; i &lt; selectedItems.length; i++) {
      var dataItem = grid.dataItem(selectedItems[i]);
      if (dataItem != undefined)
          dataItem.set("Item", SelectedItem);
  }
  }
  </code></pre>
  
  <p>Does anyone know why this might be happening?</p>