Winform checkedListBox问题
private void frmMain_Load(object sender, EventArgs e)
{
checkedListBox1.DataSource = new string[]{"1","2"};
//这样可以绑定数据。
//我希望在里将checkedListBox1中的每一项的选择状态设为选中的,请问怎么做?
}
for (int i = 0; i < this.checkedListBox1.Items.Count; i++)
{
this.checkedListBox1.SetItemChecked(i, true);
}
这样写在上面中是不行的。