WPF ListView 组重复列标题
当使用分组的 CollectionViewSource 作为 ListView 的源时,有没有办法在 ListView.GridView 的每个组内重复列标题?
我正在使用 http://msdn.microsoft.com/en- 中的示例us/library/ms754027.aspx 它使用 Expander 控件来显示每个组。
我希望列标题出现在每个组的扩展器内,而不是出现在 ListView 的顶部。
Is there a way to repeat the column headers inside each group of a ListView.GridView when using a grouped CollectionViewSource as the source of the ListView?
I am using the example at http://msdn.microsoft.com/en-us/library/ms754027.aspx which uses an Expander control to display each group.
I would like the column headers to appear inside the expander for each group instead of at the top of the ListView.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我还没有尝试过这一点,但您也许可以在组标题中包含 GridViewHeaderRowPresenters:
如果这不起作用,一种可靠的方法是添加一个用 VisualBrush 绘制的矩形,该矩形引用了该矩形-并且仅 GridViewHeaderRowPresenter 位于 GridView 的顶部。
这可以通过在矩形上使用的附加属性来完成。设置附加属性后,它会注册一个低优先级的 Dispatcher 回调:
矩形本身将是像这样的东西:
I haven't tried this, but you may be able to include GridViewHeaderRowPresenters inside your group headers:
If that doesn't work, one sure-fire way to do it is to add a Rectangle that is painted with a VisualBrush that references the one-and-only GridViewHeaderRowPresenter at the top of the GridView.
This can be done with an attached property to be used on the Rectangle. When the attached property is set, it registers a low priority Dispatcher callback that:
The Rectangle itself would be something like this: