/// <summary>
/// 遍历选中
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ckItem_CheckedChanged(object sender, EventArgs e)
{
if (ckItem.Checked == true)
{
for (int k = 0; k < this.ckBoxItem.Items.Count; k++)
{ ckBoxItem.SetItemChecked(k, true); }
this.ckItem.Text = "反选";
}
else
{
for (int k = 0; k < this.ckBoxItem.Items.Count; k++)
{ ckBoxItem.SetItemChecked(k, false); }
ckItem.Text = "全选";
}
}
/// <summary>
/// 取得值
/// </summary>
public void GetValue()
{
string positionIDs = string.Empty;
foreach (DataRowView item in this.ckBoxPosition.CheckedItems)
{
positionIDs += item.Row["lngpositionid"].ToString() + ",";
}
MessageBox.Show(positionIDs);
}