E:\ASP.net\temp\WebSite1
CheckBox2控件的 AutoPostBack属性设置为true.
protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
for(int i=0;i<=GridView1.Rows.Count-1;i++)
{
CheckBox chk = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");
if (CheckBox2.Checked == true)
{
chk.Checked = true;
}
else
{
chk.Checked = false;
}
}
}