I tried to resolve it by myself, but it is not getting resolved below is JavaScript, which is i am using for calculating total of Gridview last column total but it is two column values in footer,
Second thing if i change any value in GridView, it also must be update txttotal textbox which is outside of GridView
![https://i.ibb.co/v4v2VJ2/tota.png](https://i.imgur.com/XpiNQKp.png)
Below is gridview and JS
<script type="text/javascript">
$(function () {
//Calculate and update Grand Total.
var grandTotal = 0;
$("[id*=lbltotal]").each(function () {
grandTotal = grandTotal + parseFloat($(this).html());
});
$("[id*=txtTotal]").val(grandTotal.toString());
});
</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GVFood" Width="97%" PagerStyle-CssClass="pager" HeaderStyle-CssClass="header" ShowFooter="true"
RowStyle-CssClass="rows" runat="server" AutoGenerateColumns="false" auttopostback="true"
OnRowEditing="GVFood_RowEditing" OnRowDataBound="GVFood_RowDataBound" OnRowDeleting="GVFood_RowDeleting"
Height="216px" CssClass="auto-style15">
<Columns>
<asp:TemplateField HeaderText="S.No">
<ItemTemplate>
<%#Container.DataItemIndex+1 %>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="B_ID" HeaderText="Codeitem" Visible="false" />
<asp:BoundField DataField="B_Name" HeaderText="Descriptionitem" ReadOnly="true" />
<%--<asp:BoundField DataField="QTY" HeaderText="QTY" onkeyup="CalculateTotals();" ControlStyle-Width="20px" />--%>
<asp:TemplateField HeaderText="Quantity">
<ItemTemplate>
<asp:TextBox ID="QTY" Text='<%#Eval("QTY") %>' Enabled="true" AutoPostBack="True" OnTextChanged="QTY_TextChanged" runat="server" ControlStyle-Width="50px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Price">
<ItemTemplate>
<asp:TextBox ID="Rate" runat="server" Width="50px" Enabled="true" AutoPostBack="True" OnTextChanged="Rate_TextChanged" Text='<%#Eval("Rate") %>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Dis">
<ItemTemplate>
<asp:TextBox ID="txtdisc" runat="server" AutoPostBack="True" OnTextChanged="txtdisc_TextChanged" Width="50px" Enabled="true" Text='<%#Eval("txtdisc") %>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="S.Total">
<ItemTemplate>
<asp:Label ID="lbltotalDisc" runat="server" Text=""></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total">
<ItemTemplate>
<asp:Label ID="lbltotal" runat="server" Text='<%# Eval("lbltotal") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblGrandTotal" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:CommandField ShowDeleteButton="True" ButtonType="Link" />
</Columns>
</asp:GridView>
</ContentTemplate>
<Triggers>
</Triggers>
</asp:UpdatePanel>
Grand Total :
<asp:TextBox ID="txtTotal" runat="server" Height="19px" Width="58px" Enabled="False"></asp:TextBox>