I have a ListView. The user must select some elements and dragDrop elsewhere. This does not require CTRL + click, which is good. but after all the selection is made, when I try to start dragging and dropping, the left click does not select the element that was clicked. How can I make it behave like Windows Explorer, so the choice does not change when I start to drag and drop. I spent a lot of time, tried some declared solutions there, as well as for subclassing both ListView and ListViewItem and messing around with PreviewMouseLeftButtonDown, but nothing worked for me. TIA!
<ListView SelectionMode="Multiple" Grid.Column="1" >
<ListView.View>
<GridView>
<GridViewColumn Width="25">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem, AncestorLevel=1}}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="200" />
</GridView>
</ListView.View>
<ListView.Items>
<ListViewItem>1 - The one and only</ListViewItem>
<ListViewItem>2 - The second and only</ListViewItem>
<ListViewItem>3 - The third and only</ListViewItem>
<ListViewItem>4 - The 4th and only</ListViewItem>
<ListViewItem>5 - The 5th and only</ListViewItem>
<ListViewItem>6 - The 6ht and only</ListViewItem>
</ListView.Items>
</ListView>
source
share