<ItemTemplate>
<asp:LinkButton ID="btnEdit" runat="server">Edit</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
Which will open a modal form, immediately after that the grid is refreshed in the background and collects items. I want the grid to remain in the view summary it was before the button was clicked.
<script type="text/javascript">
$("body").on("click", "[src*=plus-square]", function () {
$("[src*=dash-square]").each(function () {
$(this).trigger('click');
});
$(this).closest("tr").after("<tr><td></td><td colspan ='999'>" + $(this).next().html() + "</td></tr>")
$(this).attr("src", "src/dash-square.svg");
});
$("body").on("click", "[src*=dash-square]", function () {
$(this).attr("src", "src/plus-square.svg");
$(this).closest("tr").next().remove();
});
</script>
<div class="container">
<div class="messagealert" id="alert_container"></div>
<div style="width: contain; overflow-x: auto;">
<asp:GridView
ID="myDataTable"
DataKeyNames="DOWO_ID"
runat="server"
Style="width: 100%"
CssClass="table table-hover table-striped"
GridLines="None"
AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False"
OnRowDataBound="myDataTable_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<img alt="" style="cursor: pointer" src="src/plus-square.svg" />
<asp:Panel ID="pnlOrders" runat="server" style="display: none;">
<asp:GridView
ID="myOrders"
DataKeyNames="DOWOI_ID"
runat="server"
Style="width: 100%"
CssClass="table table-hover table-striped"
GridLines="None"
AllowPaging="False"
AllowSorting="True"
AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="DOWOI_ID" HeaderText="ID" />
<asp:BoundField DataField="DOWO_ID" HeaderText="ID St"/>
<asp:BoundField DataField="DOWOI_Order" HeaderText="Order" />
<asp:TemplateField ItemStyle-VerticalAlign="Middle">
<ItemTemplate>
<asp:LinkButton ID="btnEdit" runat="server">Otvori</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="cursor-pointer" VerticalAlign="Middle" />
</asp:GridView>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="DOWO_ID" HeaderText="ID" SortExpression="DOWO_ID" />
<asp:BoundField DataField="DOWO_BarCode" HeaderText="Barcode" SortExpression="DOWO_BarCode" />
</Columns>
<PagerSettings Mode="NumericFirstLast" />
<RowStyle CssClass="cursor-pointer" VerticalAlign="Middle" />
<SortedAscendingHeaderStyle CssClass="bi bi-sort-up" />
<SortedDescendingHeaderStyle CssClass="bi bi-sort-down" />
</asp:GridView>
</div>
<div id="myModal" class="modal fade" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header"></div>
<div class="modal-body">
<table>
<tr>
<td>
<div class="input-group input-group-sm">
....
</div>
</td>
</tr>
</table>
</div>
<div class="modal-footer">
<button id="btnCloseModal" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save Changes</button>
</div>
</div>
</div>
</div>
</div>