关于复选框(CheckBoxList)设置默认值的一个问题. 我有一个CheckBoxList,有属性值若干...想请教如何设定多个默认的初始值。例如:待选答案:A,B,C,D,E,F我想默认选中的: A,D,E用CheckBoxList.SelectedValue似乎只能设置一个默认选项。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 看看是否符合要求。this.checkedListBox1.SetItemChecked(0,true);this.checkedListBox1.SetItemChecked(3,true);this.checkedListBox1.SetItemChecked(5,true); 静态选项可以直接在页面上写<asp:ListItem Value="1" Selected="True">1</asp:ListItem> 我是动态的..to: loveZHYforEver(只爱陌生人) 谢谢你的方法。因为是动态的,只知道几个值,并不知道每个对应的索引是哪个,所以这样似乎不太完美.. 做个for循环for (int i = 0;i < this.checkbox.items.count;i++){ if (this.checkbox.items[i].value == 你的value) { this.checkbox.items.Selected = true; }} 求助:使用xml提交表单的问题 关于线程 programming c#和c#和.net2.0实战两本书哪本好点啊? 没有人知道吗, 消息框问题 大家帮我看看把 怎么让控件通过安全策略 C# 实现多串口数据采集,串口通讯使用问答通讯模式 MVC的Ajax.ActionLink如何给Action付值呢? 怎么把二进制文件读入到一个结构体? 请教弹出窗口的刷新,自动又弹出新窗口问题. 给点提示
this.checkedListBox1.SetItemChecked(0,true);
this.checkedListBox1.SetItemChecked(3,true);
this.checkedListBox1.SetItemChecked(5,true);
<asp:ListItem Value="1" Selected="True">1</asp:ListItem>
{
if (this.checkbox.items[i].value == 你的value)
{
this.checkbox.items.Selected = true;
}
}