I have a ListView
and I wanted to add some new items to its ListView.SelectedItems
.
I was using a slow approach:
for (int i = beginIndex; i <= endIndex; i++)
{
myListView.SelectedItems.Add(myObjectList[i]);
}
If myListView is empty before add, I could use this answer to add selected items. But in case myListView already has some SelectedItems
, and I want to add more, I cannot use ListView.SetSelectedItems()
.
How can I add selected items more effectively? Is there an AddRange() function or a similar method?