| How to count the checkbox checked or not in GridView
Below is the code to check total checkbox checked in Gridview
int tot=0;
foreach (GridViewRow r in GridView1.Rows)
{
CheckBox chkBox = new CheckBox();
chkBox = ((CheckBox)GridView1.FindControl("checkbox1"));
if(chkBox.Checked)
{
tot = tot + int.Parse(r.Cells[4].Text);
}
}
Label1.Text=tot | | |