Hi ucrhlyn,
Check this example. Now please take its reference and correct your code.
Code will remain same as in the link.
HTML
<asp:Repeater ID="rptCustomers" runat="server" OnItemDataBound="OnItemDataBound">
<HeaderTemplate>
<table>
<tr>
<th scope="col"><input type="button" value="Collapse All" id="btnCollapse" /></th>
<th scope="col" style="width: 150px">Contact Name</th>
<th scope="col" style="width: 150px">City</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<img alt="" style="cursor: pointer" src="images/plus.png" />
<asp:Panel ID="pnlOrders" runat="server" Style="display: none">
<asp:Repeater ID="rptOrders" runat="server" OnItemDataBound="OnItemDataBound1">
<HeaderTemplate>
<table class="ChildGrid" cellspacing="0" rules="all" border="1">
<tr>
<th scope="col"> </th>
<th scope="col" style="width: 150px">Order Id</th>
<th scope="col" style="width: 150px">Date</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<img alt="" style="cursor: pointer" src="images/plus.png" />
<asp:Panel ID="pnlOrders" runat="server" Style="display: none">
<asp:GridView ID="gvOrderDetails" runat="server" AutoGenerateColumns="false"
OnRowDataBound="OnRowDataBound" OnDataBound="OnDataBound" OnRowCreated="OnRowCreated">
<Columns>
<asp:BoundField DataField="OrderId" HeaderText="OrderId" />
<asp:BoundField DataField="UnitPrice" HeaderText="Price" DataFormatString="{0:N2}" />
<asp:BoundField DataField="Quantity" HeaderText="Quantity" />
<asp:TemplateField HeaderText="Total">
<ItemTemplate>
<asp:Label ID="lblTotal" runat="server" Text="0" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</asp:Panel>
</td>
<td><asp:Label ID="lblOrderId" runat="server" Text='<%# Eval("OrderId") %>' /></td>
<td><asp:Label ID="lblOrderDate" runat="server" Text='<%# Eval("OrderDate","{0:dd/MM/yyyy}") %>' /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</asp:Panel>
<asp:HiddenField ID="hfCustomerId" runat="server" Value='<%# Eval("CustomerId") %>' />
</td>
<td><asp:Label ID="lblContactName" runat="server" Text='<%# Eval("ContactName") %>' /></td>
<td><asp:Label ID="lblCity" runat="server" Text='<%# Eval("City") %>' /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$("body").on("click", "[src*=plus]", function () {
$(this).closest("tr").after("<tr><td></td><td colspan = '999'>" + $(this).next().html() + "</td></tr>")
$(this).attr("src", "images/minus.png");
});
$("body").on("click", "[src*=minus]", function () {
$(this).attr("src", "images/plus.png");
$(this).closest("tr").next().remove();
});
$("body").on("click", "[id*=btnCollapse]", function () {
$("[src*=minus]").each(function () {
$(this).trigger('click');
});
});
</script>
Screenshot