title: check/uncheck, Checkboxlist in gridview ASP.Net
body: <p>I have 2 columns in gridview, branchname and its subbranch. Both details are retrieved from database.<br>
  1.branch name--><code>checkbox</code><br>
  2.subbranch --> <code>checkboxlist</code><br>
  If I check each branch name contains all subbranch name in its subbranch column,
  My query is if I select branch name1 all its corresponding branchnames should be selected .<br>
  Please help me for this .</p>
  
  <pre><code>    &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
          Height="315px" Width="476px" OnRowDataBound="rowdatabound" 
          onselectedindexchanged="GridView1_SelectedIndexChanged"&gt;
      &lt;Columns&gt;
      &lt;asp:TemplateField HeaderText="ID"&gt;
      &lt;ItemTemplate&gt;
      &lt;asp:Label ID="lblid" runat="server" Text='&lt;%#Eval("did") %&gt;'&gt;
      &lt;/asp:Label&gt;
      &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
      &lt;asp:TemplateField HeaderText=""&gt;
      &lt;ItemTemplate&gt;
      &lt;asp:CheckBox ID="chkdivname" runat="server" Text='&lt;%#Eval("branchname") %&gt;' onclick = "checkAll(this);" /&gt;
      &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField &gt;
  &lt;asp:TemplateField HeaderText=""&gt;
  &lt;ItemTemplate&gt;
  &lt;asp:CheckBoxList ID="CheckBoxList1" runat="server"
          DataSourceID="SqlDataSource1" DataTextField="subBranchname" DataValueField="Bid" onclick = "Check_Click(this)"&gt;
      &lt;/asp:CheckBoxList&gt;
      &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" 
          ConnectionString="&lt;%$ ConnectionStrings:SowmiaConnectionString %&gt;" 
          SelectCommand="SELECT [Bid], [Branchname] FROM [BranchName]"&gt;
      &lt;/asp:SqlDataSource&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>THANKS IN ADVANCE</p>