Calculate total by javascript in gridview with paging
Posted
by louis
on Stack Overflow
See other posts from Stack Overflow
or by louis
Published on 2010-05-02T13:10:08Z
Indexed on
2010/05/02
13:27 UTC
Read the original article
Hit count: 442
Without paging function, i can loop through the gridview by using
var sum = 0;
var gridViewCtlId = '<%=timesheetView.ClientID%>';
var grid = document.getElementById(gridViewCtlId);
var gridLength = grid.rows.length;
so with gridLength i can loop through the gridview to sum all rows. However, when I use paging event of gridview, i use the page size to loop through all rows, but it occurs errors because the last page may not have enough rows. So would you please to help me how to get the rows in the each page of gridview?
© Stack Overflow or respective owner