Use a repeater (or nested repeaters) to create the layout and java-script for beaveavior. For example, let's say your dataset has two tables - "Groups" and "Elements" and the foreign key relationship between the tables "FK_Groups_Items". Then you can use a repeater like
<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 after js function
function OnGroupClick(group) {
for(item in group.getElementsByTagName('input')) {
item.checked = group.checked;
}
}
: , /