通过拖动启用 ListView 多选

发布于 2024-07-09 21:26:40 字数 166 浏览 4 评论 0原文

如何通过拖动在 WPF ListView 中启用多选?

将 SelectionMode 属性设置为 Extended 确实允许使用 Shift 和 Ctrl 进行多选,但不能通过单击和拖动进行多选。 将 SelectionMode 属性设置为 Multiple 会产生粘性选择,这不是我想要的。

How do I enable multi-select in a WPF ListView by dragging?

Setting the SelectionMode property to Extended does allow multi-select using Shift and Ctrl, but not by clicking and dragging. Setting the SelectionMode property to Multiple gives a sticky selection which isn't what I want.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

追我者格杀勿论 2024-07-16 21:26:40

您可以扩展 ListViewListViewItem 来实现单击和拖动多选行为。

此处发布了一个非常类似的解决方案。

You could extend ListView and ListViewItem to implement click and drag multi-select behavior.

A very similar solution was posted here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文