Im coming to my mind trying to figure it out. I am experienced in WPF, but I have never seen anything like it.
I have a ListBox that contains selectable ListBoxItems. Items in the list can be selected by clicking the mouse or using the up / down arrows. Im using SelectionMode.Extended, so my list supports several options.
Problem: clicking on an item in the list, then Shift-Clicking on another item selects the correct range of items as you expected. Unfortunately, using the up / down arrows does not work properly - instead, the selected range will always depend on the last CLICKED element, and not the element that was selected using the arrow keys.
For instance:
[Item 1] <- Click this item [Item 2] <- Use the down arrow to select this item [Item 3] <- Shift-Click this item
You expect items 2 and 3 to be selected, instead all items (1, 2 and 3) will be selected.
All ListBox properties have the correct values (i.e., using the arrow keys it updates the SelectedItems property), my only problem seems to be with the way the ListBox handles the Shift-Click selection inside. As far as I know, I believe that this is due to the fact that the "Multi-select anchor" ListBoxs is installed with the mouse, but not with the arrow keys.
Has anyone come across and solved this before? Is there a way to set the "multi-select anchor" manually? Thanks for your help!
Chris
Chris source share