{
CheckBox chk = new CheckBox()
chk.Text = "testall" // 这里可以换成数据库的内容
chk.CheckedChanged += new EventHandler(chk_CheckedChanged)
chk.AutoPostBack = true
Page.Form.Controls.Add(chk)
for (int i = 0i <10i++)
{
CheckBox chk2 = new CheckBox()
chk2.Text = "test" + i.ToString() // 这里可以换成数据库的内容
chk2.Checked = (i % 3 == 0)// 这里可以换成数据库的内容
Page.Form.Controls.Add(chk2)
}
}
void chk_CheckedChanged(object sender, EventArgs e)
{
CheckBox all = sender as CheckBox
foreach(Control ctl in Page.Form.Controls)
{
if (ctl is CheckBox)
{
CheckBox chk = ctl as CheckBox
chk.Checked = all.Checked
}
}
}
{name:'hdryid',index:'hdryid', hidden:true, editable:true, editrules: { edithidden: true }, edittype:"select", editoptions:{dataUrl:"/jyxt/User/getJSJQComboxData.do"}, align:"center",sortable:true,width:120,formoptions:{rowpos:5, colpos:1}}欢迎分享,转载请注明来源:内存溢出
评论列表(0条)