protected void GetPreviousTotal()
{
DataSet dset = get data from database;
OR
DataSet dset = get data from viewstate
for (int i = 0; i < dset.Tables[0].Rows.Count; i++)
{
if (i < grdBISentry.PageIndex * grdBISentry.PageSize)
{
total += Convert.ToDouble(dset.Tables[0].Rows[i]["COLUMN_NAME"].ToString());
}
else
break;
}
}
from here[^]
-KR