Use repeater (or nested repeaters) to generate layout and java-script for beahavior. For example, lets say your dataset has two tables - Groups and Items and there foreign key relation among tables named "FK_Groups_Items". Then you can repeater such as
<ol>
<asp:Repeater ID="Groups" runat="server">
<itemtemplate>
   <ul>
   <asp:CheckBox runat="server" ID="Group" Text="'<%# Eval("Name") %>'" Value='<%# Eval("Value") %>' onclick="OnGroupClick">
   <p class="nested">
     <asp:CheckBoxList runat="server" ID="Items" DataSource='<%# ((DataRowView)Container.DataItem).CreateChildView("FK_Groups_Items") %>'> DataValueField="Value" DataTextField="Name" />
   </p>
   </ul>
</itemtemplate>
</asp:Repeater>
</ol>
and following js function
function OnGroupClick(group) {
  for(item in group.getElementsByTagName('input')) {
     item.checked = group.checked;
  }
}
Disclaimer: untested code just to give an hint/idea of approach