Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Checkbox column and checkbox in column header in ultrawebgrid


I have created a templated column and a templated column header. Here is the code snippet:

    <igtbl:UltraGridBand key="ugb1">
      <igtbl:TemplatedColumn Key="check" Type="CheckBox" AllowUpdate="Yes">
                  <input id="chkSelectAll" name="SelectAll" type="checkbox" onclick="chkSelectAll_CheckedChanged" AutoPostBack="true"  />

The ultrawebgrid shows a column containing checkboxes, and the header of the same column contains a checkbox. 
I want a c# function chkSelectAll_CheckedChanged, which is called when the checkbox in header column is clicked.
It should select all the checkboxes in all the rows, if they are not already selected(i.e. if only some or none of them are selected). And if all of them are selected, it should deselect them.

I am using .net 4.0 framework.

Please help with the c# code which that function should contain.