title: Check/Uncheck all the items in a checkbox column of a Telerik/Kendo Grid
body: <p>I have a telerik Grid with three columns. I only post here the columns declaration to focus only in it:</p>
  
  <pre><code>        .Columns(columns =&gt;
          {
              columns.Bound(s =&gt; s.field1).Filterable(false);
              columns.Bound(s =&gt; s.field2).Filterable(false);                
              columns.Bound(s =&gt; s.BoolField).HeaderTemplate("&lt;label&gt;&lt;input id='selectall' class='chkbx' type='checkbox' onclick='ToggleChkBox(this.checked);'&gt;All selected&lt;/label&gt;")
                                          .ClientTemplate("&lt;input type='checkbox' class='chkbxq' name='chkEnabled' &lt;#= BoolField ? checked='checked' : '' #&gt; 'text-align:center' onclick='onClickCheckBoxColumn()'/&gt;")
                     .ReadOnly(false)
                     .Title("Activa")
                     .Width(40)
                     .HtmlAttributes(new { style = "text-align:center" })
                     .HeaderHtmlAttributes( new { style = "text-align:center" });                
          })
  </code></pre>
  
  <p><strong>Javascript function</strong>:</p>
  
  <pre><code>function ToggleChkBox(flag) {
      $('.chkbxq').each(function () {            
          $(this).prop('checked', flag);
      });
  }
  </code></pre>
  
  <p>This grid has a checkbox column. Also I have placed a checkbox in the column header. When this checkbox in the column header is checked I want to check all the checkboxes in the column and when it is unchecked I want to uncheck all the checkboxes of the column. The above function ToggleChkBox works but only for the items in the current page of the grid, for example, If grid is displaying items in first page, all items in first page are checked/unckecked but the rest of items in the other pages are not being checked/unchecked. So how can I check/uncheck all the items in all grid pages from javascript function?</p>