반응형
checkedComboBoxEdit multi select false
private void checkedComboBoxEdit1_Popup(object sender, EventArgs e)
{
CheckedListBoxControl list = (sender as IPopupControl).PopupWindow.Controls.OfType<PopupContainerControl>().First().Controls.OfType<CheckedListBoxControl>().First();
list.ItemCheck -= list_ItemCheck;
list.ItemCheck += list_ItemCheck;
}
void list_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
{
if (e.State == CheckState.Checked)
{
CheckedListBoxControl list = sender as CheckedListBoxControl;
List<CheckedListBoxItem> items = new List<CheckedListBoxItem>();
foreach (int index in list.CheckedIndices)
{
if (index == e.Index) continue;
items.Add(list.Items[index]);
}
foreach (CheckedListBoxItem item in items)
item.CheckState = CheckState.Unchecked;
}
}
반응형
'DevExpress' 카테고리의 다른 글
Menu Test (0) | 2021.03.16 |
---|---|
PieChart (0) | 2021.03.16 |
Half Circle Gauge Chart (0) | 2021.03.16 |
Bar, Line Chart (0) | 2021.03.16 |
Devexpress checkedcomboboxedit multiselect (0) | 2021.03.09 |