将项目拖放到所需位置 Listview WinRT [英] Drag and Drop Items in desired position Listview WinRT

查看:28
本文介绍了将项目拖放到所需位置 Listview WinRT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这篇博文的帮助下,我能够实现从一个 ListView 到另一个 ListView 的拖放

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

Windows 8拖放

我还可以在同一个 ListView 中重新编码项目

I am also able to reoder items in the same ListView

CanReorderItems="True"

但我无法将项目从一个 ListView 控件拖放到所需位置的另一个 ListView 控件.

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

有什么方法可以找出发生掉落的位置,以便我可以使用 Insert 方法在该位置插入.

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

推荐答案

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

GridViewEx 控件为以下情况实现拖放常规 GridView 控件不支持:

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

  • 对于 WrapGrid、StackPanel 和 VirtualizingStackPanel 以外的项目面板.
  • 启用分组时.

它还允许将新组添加到基础数据源,如果用户将某个项目拖到最左侧或最右侧的边缘控制.

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.

谢谢@Xyroid!!这正是我要找的

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

这篇关于将项目拖放到所需位置 Listview WinRT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆