Rowshan Ali

Rowshan Ali

  • NA
  • 64
  • 142.6k

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

Mar 31 2013 2:10 AM
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)