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

Last Reply 6 months ago By Andrea

Posted 6 months 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());

Please Guide.

Posted 6 months 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.