Drag and Drop Items in desired position Listview W

2019-08-03 02:18发布

问题:

I am able to implement drag and drop from one ListView to the other ListView with the help from this blogpost

Windows 8 Drag Drop

I am also able to reoder items in the same ListView

CanReorderItems="True"

But I am not able to drop an item from one ListView control to the other ListView control in the desired location.

Is there any way to find out the position where the drop occurred so that I can insert at that location using Insert method.

回答1:

http://www.codeproject.com/Articles/536519/Extending-GridView-with-Drag-and-Drop-for-Grouping

The GridViewEx control implements drag and drop for cases which are not supported by the regular GridView control:

  • For items panels other than WrapGrid, StackPanel, and VirtualizingStackPanel.
  • When grouping is enabled.

It also allows adding new groups to the underlying data source if the user drags some item to the left-most or right-most edges of the control.

Thank you @Xyroid!! This is exactly what I was looking for



回答2:

This should help:

XAML ListView and GridView reorder and drag and drop sample (Windows 8.1) http://code.msdn.microsoft.com/windowsapps/XAML-ListView-and-GridView-6bd77f71