Display Grand Total in TextBox outside GridView using jQuery in ASP.Net

Last Reply 28 days ago By Andrea

Posted 28 days ago

I am trying to display grand total of Total Column of gridview in textbox(txtTotal) which is out side of Gridview, but result is not coming.

here is used Jave Script for grand Total.

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
    $(function () { 
        //Calculate and update Grand Total.
        var grandTotal = 0;
        $("[id*=lblProductTotal]").each(function () {
            grandTotal = grandTotal + parseFloat($(this).html());
        });
        $("[id*=txtTotal]").html(grandTotal.toString());
    });
</script>

Please Guide.

Posted 28 days ago
Hi @akhter,
Please try the following

Calculate Total and Grand Total in GridView with TextBox using jQuery in ASP.Net

It might help you.

Cheers Andrea.