title: How to get GridView checkAll checkbox to not fire the individual checkboxes?
body: <p>I have a GridView with each row containing a checkbox, and the header of that column is a checkbox with checkAll functionality:</p>
  
  <pre><code>&lt;Columns&gt;
       &lt;asp:TemplateField&gt;
              &lt;HeaderTemplate&gt;
                     &lt;input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);"                                       runat="server" type="checkbox" /&gt;
              &lt;/HeaderTemplate&gt;
              &lt;ItemTemplate&gt;
                     &lt;asp:CheckBox ID="chkSelect" runat="server" ToolTip="Select this order" AutoPostBack="true" OnCheckedChanged="chkSelect_OnCheckedChanged"/&gt;
              &lt;/ItemTemplate&gt;
       &lt;/asp:TemplateField&gt;
       ...More BoundFields
  &lt;/Columns&gt;
  </code></pre>
  
  <p>The javascript behind the SelectAllCheckboxes()</p>
  
  <pre><code>function SelectAllCheckboxes(spanChk) {
  
          // Added as ASPX uses SPAN for checkbox
  
          var oItem = spanChk.children;
          var theBox = (spanChk.type == "checkbox") ?
      spanChk : spanChk.children.item[0];
          xState = theBox.checked;
          elm = theBox.form.elements;
  
          for (i = 0; i &lt; elm.length; i++)
              if (elm[i].type == "checkbox" &amp;&amp;
            elm[i].id != theBox.id) {
                  //elm[i].click();
  
                  if (elm[i].checked != xState)
                      elm[i].click();
                  //elm[i].checked=xState;
  
              }
      }
  </code></pre>
  
  <p>My GridView basically contains sales (orders) from my website, so dollar amounts.  The OnCheckedChanged event adds (if checked) or subtracts (if unchecked) the current row's price from a totalAmount that is displayed on the page.
  This all works great except that when I click the checkAll checkbox, all of the OnCheckedChanged events for all of the row check boxes fire and it takes a long time to process it all.  Since all that I am doing in the OnCheckedChanged method is summing amounts, is there a way that I can NOT call the events for the individual checkboxes and just make one call to a separate method that will grab all the GridView rows and sum them all at once?</p>