Drag and Drop Items in desired position Listview WinRT

一笑奈何 提交于 2019-12-24 13:17:46

问题


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



来源:https://stackoverflow.com/questions/18246856/drag-and-drop-items-in-desired-position-listview-winrt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!