trol设置为单选框

trol设置为单选框

   

 private void chkControl_ItemChecking(object sender, DevExpress.XtraEditors.Controls.ItemCheckingEventArgs e)
{
SingleSelectCheckedListBoxControls(chkControl, e.Index);
} /// <summary>
/// 把CheckedListBoxControl设置为单选框
/// </summary>
/// <param name="chkControl">CheckedListBoxControl</param>
/// <param name="index">index当前选中的索引</param>
public void SingleSelectCheckedListBoxControls(CheckedListBoxControl chkControl, int index)
{
if (chkControl.CheckedItems.Count > 0)
{
for (int i = 0; i < chkControl.Items.Count; i++)
{
if (i != index)
{
chkControl.SetItemCheckState(i, System.Windows.Forms.CheckState.Unchecked);
}
}
}
}

  

04-28 10:22