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;
}
}
}
原文地址:https://www.cnblogs.com/sunnywam/p/12181260.html
时间: 2024-11-08 02:23:56