WPF Listview 3 个差异列表的不同替代行颜色..?
如何为 WPF 列表视图设置备用行颜色。 如果我只有 1 个列表,我可以在 XAML 中设置,但就我而言,需要根据列表更改备用行颜色。 例如,我有 3 个差异列表...
1) 按公司名称订购,
2) 按部门排序
3) 按市值排序
每个列表都应该有自己的备用行颜色。
我怎样才能做到这一点(在 C# 或 XAML 文件中)。任何想法/建议将不胜感激
How do i set alternate row colors for WPF Listview.
If i have only 1 list I can set in XAML, but in my case, the alternate row colors need to be changed based on the list.
For example,i have 3 diff lists...
1) order by Company name,
2) order by Sector
3) order by Market value
Each list should have their own alternate row colors.
How can i do that(in C# or in XAML file).Any Ideas/Suggestions would be aprreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无论您对列表执行什么操作,这都应该有效,因为 ItemsControl.AlternationIndex 是依赖项属性并且应该更新:
用于测试项目更改的代码隐藏:
This should work no matter what you do to the list since ItemsControl.AlternationIndex is a dependency property and should get updated:
Code Behind to test changes to items: