Hi,
i want to display sum in footer
here is gridview
<asp:GridView ID="GridView1" runat="server" ShowFooter="true" >
<RowStyle CssClass="record" />
<FooterStyle CssClass="Footer" />
</asp:GridView>
here is code
var totalHr = 0;
var totalHr1 = 0;
$("#GridView1 tr td").filter(":not(td:first-child)").each(function () {
firstcelltext = $(this).parent().find("td:first-child").text();
var fcelltext = firstcelltext.replace(/ /g, '-');
var colindex = $(this).closest("tr td").prevAll("tr td").length;
var headertext = $("table[id*=GridView1] th").eq(colindex).text();
firstcelltext = $(this).parent().find("td:first-child").text();
var fcelltext = firstcelltext.replace(/ /g, '-');
var colindex = $(this).closest("tr td").prevAll("tr td").length;
var headertext = $("table[id*=GridView1] th").eq(colindex).text();
var cellText = $(this).text();
if ($.trim(cellText) == '') {
$(this).css('background-color', 'LightGreen');
}
else {
var idn = $(this).attr("id");
if (headertext == 2500) {
var name = $(this).text();
totalHr += parseFloat(name.replace(":", "."));
}
if (headertext == 2501) {
var name1 = $(this).text();
totalHr1 += parseFloat(name1.replace(":", "."));
}
}
if ($(this).hasClass("Footer")) {
$(this).empty();
$(this).append("<td colspan='2' align='right'> " + totalHr + "</td>");
}
});
iam getting value of totalHr
but it doesn't display in footer
how to solve this
Regards
Baiju