XAML WPF 垂直滚动条在分组时逐行而不是逐组

发布于 2024-08-22 07:14:33 字数 58 浏览 5 评论 0原文

我想要做的是,当列表视图中的项目分组并且按下垂直滚动条的向下/向上箭头按钮时,逐行滚动而不是逐组滚动。

What I want to do is scrolling line by line instead of group by group when my items in listview are grouped and I press down/up arrow button of vertical scroll bar.

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

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

发布评论

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

评论(1

萌面超妹 2024-08-29 07:14:33

我也遇到了同样的问题,找到这篇文章看看是否有答案。我终于找到了解决问题的方法。我为 ListView 控件编写了自己的 ControlTemplate,但没有添加以下触发器:

<Trigger Property="IsGrouping" Value="true">
     <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</Trigger>

显然,如果将 ScrollLViewer.CanContentScroll 属性设置为 false,它将像魅力一样工作。似乎违反直觉,但它对我有用。如果您发布更多代码,也许我们可以为您提供更多帮助。

I had this same problem and found this post to see if there was an answer. I finally found a solution to the problem. I wrote my own ControlTemplate for the ListView control and I didn't add the following trigger:

<Trigger Property="IsGrouping" Value="true">
     <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</Trigger>

So apparently, if you set the ScrolLViewer.CanContentScroll property to false, it will work like a charm. Seems counter-intuitive, but it worked for me. If you post more code, maybe we could help you more.

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