Click here to Skip to main content
16,017,376 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having a gridview with a columns Checkbox,Name and "Cost" and i am using paging .
when ever i would select a checkbox i need to add the cost in a textbox after paging too in a textbox.
please could anybody suggest me.

thanx in advance
Posted

protected void GetPreviousTotal()

{

DataSet dset = get data from database;
OR 
DataSet dset = get data from viewstate // for this you need to store your dataset in viewstate when u get from database for the first time

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
 
Share this answer
 
If you need to carry forward something to the next Page, then you have use Session or ViewState to store that Data and read that when Page is changed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900