第一次使用checkedListBox,在VS2005里面没有智能提示其含有DataSource的属性,事实上,它有。
DataTable dt = ds.Tables[0];
checkedListBox_Issue.DataSource = dt;
checkedListBox_Issue.ValueMember = "ID";
checkedListBox_Issue.DisplayMember = "LoginID";
/// <summary>
/// 全选或者全不选
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void checkBox_All_CheckedChanged(object sender, EventArgs e)
{
for (int i = 0; i < checkedListBox_Issue.Items.Count; i++)
{
checkedListBox_Issue.SetItemChecked(i,checkBox_All.Checked);
}
}