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

Last Reply one month ago By Andrea

Posted one month 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.

You are viewing reply posted by: Andrea one month ago.
Posted one month 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.