To reproduce:
- Add data items which have category, and set the SelectionMode to MultiExtended
- Then use the following code and select items from different category:
private void RadListControl1_SelectedItemsChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.NewItems == null)
{
return;
}
var newCategory = (((RadListDataItem) e.NewItems[0]).DataBoundItem as MyData).Category;
var prevCategory = (radListControl1.SelectedItem.DataBoundItem as MyData).Category;
if (newCategory != prevCategory && radListControl1.SelectedItems.Count > 1)
{
radListControl1.SuspendSelectionEvents = true;
//exception
var items = radListControl1.SelectedItems.ToList();
for (int i = 0; i < items.Count - 1; i++)
{
items[i].Selected = false;
}
//after this the selection is broken and the user cannot select an item
//radListControl1.SelectedItem = null;
radListControl1.SuspendSelectionEvents = false;
}
}