平时没有用过Checkboxlist ,这次在做项目中遇到了,总结如下,仅供参考
public void GetCheckboxlist1Value()
{
if (this.checkedListBox1.CheckedItems.Count > 0)
{
foreach (DataRowView item in this.checkedListBox1.CheckedItems)
{
// code 和name 是checkedListBox1的数据源中的两列字段名称
Msg.ShowError(item["code"].ToString() + item["name"].ToString());
}
}
else
{
Msg.ShowError("提示:请选择从业资格类别!");
}
}