后台如何设置checkboxlist 不可选中
1个回答
2014-08-26
展开全部
protected void CheckBoxList0_SelectedIndexChanged(object sender, EventArgs e)
{
for (int i = 0; i < CheckBoxList0.Items.Count; i++)
{
if (CheckBoxList0.SelectedItem.Value == CheckBoxList0.Items[i].Value.ToString())
CheckBoxList0.Items[i].Selected = true;
else
CheckBoxList0.Items[i].Selected = false;
}
}
{
for (int i = 0; i < CheckBoxList0.Items.Count; i++)
{
if (CheckBoxList0.SelectedItem.Value == CheckBoxList0.Items[i].Value.ToString())
CheckBoxList0.Items[i].Selected = true;
else
CheckBoxList0.Items[i].Selected = false;
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询