3
Answers

How to check all checkbox from gridview in asp.net.

Rowshan Ali

Rowshan Ali

11y
1.4k
1
hello dear i m in problem to check all checkbox by checking one checkbox like ...

selectbuttonidPageNamebuttonnameApprov
1abc1.aspxButton1
2abc1.aspxButton2
3abc2.aspx
4abc2.aspx


please any body help me best regurds.


        protected void CheckBox6_CheckedChanged(object sender, EventArgs e)
        {
            if (CheckBox6.Checked == true)
            {
                for (int i = 0; i <= GridView2.Rows.Count - 1; i++)
                {
                    GridViewRow row = GridView2.Rows[i];
                    CheckBox Chbox = (CheckBox)row.FindControl("CheckBox7");
                    Chbox.Checked = true;
                }
            }
        }


Answers (3)