title: Kendo grid: How to check all checkboxes of selected rows?
body: <p>I am using the Telerik Kendo grid with MVC and C#.
  I have a grid, populated with some data and have added a checkbox column - used so that the user can select all.</p>
  
  <p>Now, when I check the "selectAll" checkbox, all checkboxes are checked (one for each row), as they should be. </p>
  
  <p>What I want to do: I want to be able to double-click on a row and have the chechbox check change - if it is unchecked, a dbl-click will check it and visa versa.</p>
  
  <p>Also, as the Kendo grid allows the user to select many (mousedown, drag and mouseup - like when selecting icons on the desktop), I'd like to have it so that when the user does this action, all the selected rows have their checkboxes checked and again, if they are already checked, then this action will cause the checkboxes to become unchecked.</p>
  
  <p>Details:</p>
  
  <ul>
  <li>Grid name: Grid   </li>
  <li>JQuery version: 1.8.3 </li>
  <li>MVC 4</li>
  <li>Latest KendoUI</li>
  </ul>
  
  <p>Code for checking all checkboxes when the "selectAll" checkbox is checked:</p>
  
  <pre><code>$(document).ready(function () {
  var grid = $('#Grid').data('kendoGrid');
      grid.thead.find("th:last")
      .append($('&lt;input class="selectAll" type="checkbox"/&gt;'))
      .delegate(".selectAll", "click", function () {
          var checkbox = $(this);
          grid.table.find("tr")
              .find("td:last input")
              .attr("checked", checkbox.is(":checked"))
              .trigger("change");
      });
  });
  </code></pre>
  
  <p>I am a total beginner with Javascript so any help would be much appreciated.</p>