Click here to Skip to main content
15,921,716 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have used script to checked single checkbox in gridview ....
then i want to get selected checked checkbox in gridview so have
following code which is not working plz help to find out errors


for (int i = 0; i < gdvManageProduct.Rows.Count; i++)
{
GridViewRow row = gdvManageProduct.Rows[i];
bool isChecked = ((CheckBox)row.FindControl("chkDealOfWeek")).Checked;

if (isChecked)
{

}
}
Posted

1 solution

Check if the binding of gridview (gdvManageProduct) is done within the ispostback condition i.e
if (not Ispostback)
{
//bind the grid
}

Note:- if it is not done, when the page is posted back, the gridview is rebind, so the checked data will be lost.
 
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