I try to programmatically update the selected items in a listbox, with extended selection mode.
Here is how I do it:
foreach (var selectedItem in ItemsForSelection)
{
_myList.SelectedItems.Add(selectedItem);
}
My problem is, that when the number of the selected items is big, the update is very slow.
The root of the problem is that listbox doesn't derrive from MultiSelector, which can be tweaked to perform a fast bulk update, by using the methods BeginUpdateSelectedItems and EndUpdateSelectedItems.
Is there a way to get a similar result in a listbox?