WPF & Listview. Shift - selecting multiple items. Wrong start item

Viewed 4168

Problem explained:

Given a list containing 10 items.

  1. My first action is to (mouse) click on the second item.
  2. Secondly I have a button which is supposed to programmatically select an item.

For example:

listView.SelectedIndex = 4; 
//or
listView.SelectedItems.Add(listView.Items[4]);

The item is correctly selected.

  1. If I now press SHIFT and select the LAST item the selection starts at the clicked item and not the programmatically selected item.

One solution was to simulate a mouse click event, which worked but had side effects. Its also way to hacky.

It seems that the mouse event stores the starting item.

Is there something I have overlooked?

1 Answers
Related