Javascript -> Check/Uncheck gridview's checkboxes(ChildCheckbox) based on repeater's checkbox(ParentCheckbox)
<p>I have a javascript function below- In fact i have a checkbox in a repeater and a gridview inside that which again has some set of checkboxes.</p>

<p>I want to enable disable the gridviewCheckboxes based on the repeater checkbox selection. </p>

<p>so i have registered a javacript on itemsRepeater_ItemDataBound. to capture the - Which checkbox of repeater -> (RepeaterCheckBoxId) and Which GridView(Grid) as below.</p>

<p>function EnableDisable(RepeaterCheckboxid, Grid) 
  {</p>

<pre><code>     var grid = document.getElementById(Grid);
     if (grid == null)
         return;

     //variable to contain the cell of the grid
     var cell;

     if (grid.rows.length &gt; 0) {
         //loop starts from 1. rows[0] points to the header.
         for (i = 1; i &lt; grid.rows.length; i++) {
             //get the reference of first column
             cell = grid.rows[i].cells[1];

             cell.childNodes[0].checked = document.getElementById(RepeaterCheckboxid).checked;//If repeater checkbox is Unchecked then gridview checkboxes should be unchecked.* This is not working.

             cell.childNodes[0].disabled = !document.getElementById(RepeaterCheckboxid).checked; //If repeater checkbox is checked then gridViewCheckboxes are enabled and vice versa.This is working.


         }
     }
 }
</code></pre>

<p>But i observed that enable disable is working fine but checked unchecked is not working.
How can i uncheck all the checkboxes in gridview if the repeater's checkbox is unchecked?</p>

<p>Please help me out if you guys have any idea.</p>
