Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
protected void FullPost_Click(object sender, EventArgs e)
{
List<datakey> applyList = new List<datakey>();
CheckBox chkAll = (CheckBox)gvData.HeaderRow.Cells[0].FindControl("cbxApply");
foreach (GridViewRow row in gvData.Rows)
{
CheckBox cb = (CheckBox)row.Cells[0].FindControl("cbxApply");
if (cb != null)
if (cb.Checked)
applyList.Add(gvData.DataKeys[row.RowIndex]);
}

if (applyList.Count > 0)
{
gvData.DataBind();
}

if (ApplyTest != null)
ApplyTest();

}
Posted
Updated 25-Aug-15 19:38pm
v6
Comments
Suvendu Shekhar Giri 20-Aug-15 1:50am    
..and what your problem is?
Sinisa Hajnal 21-Aug-15 9:06am    
Enable ViewState is probably the easiest.
I would change the grid refresh so it uses Ajax, that way you prevent full postback and maintain all other control states.

Check page properties there are several maintain state (such as scroll position) properties/methods that may help.
Finally, write your own implementation - this is hardest one as you have to maintain session object with current grid state, but you have most control.

1 solution

You are getting checkbox value from Database then on OnRowDataBound you can bind data.
 
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