Silverlight 中具有模板化 RowHeader 和 ColumnHeader 的 DataGrid
如何使用模板化的 RowHeader、ColumnHeader 和 Cells 创建网格?
ViewModel 可以具有用于 RowHeader 项显示的对象列表、用于 ColumnHeader 项显示的对象列表。基本上可以将其视为矩阵显示器。
可能需要编写一个 ControlTemplate,但没有想法。关于此功能的文档不多。
有什么想法吗?
How to create a grid with a templated RowHeader, ColumnHeader, and Cells?
The ViewModel can have a list of objects for RowHeader item display, a list of objects for ColumnHeader item display. Basically think of it like a matrix display.
Probably a ControlTemplate needs to be written, but running out of ideas. There's not much of a documentation on this functionality.
Any Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为 DataGridColumnHeader 或 DataGridRowHeader 创建样式,并将 ContentTemplate 设置为允许绑定 Header 属性的 DataTemplate。为此,您需要一个启用绑定的 IValueConverter。
标头位于 Controls.Primitives 命名空间中:
样式:
转换器:
转换器实例:
You can create a style for a DataGridColumnHeader or a DataGridRowHeader and set the ContentTemplate to a DataTemplate which allows the Header property to be bound. For this you need an IValueConverter which enables the binding.
The headers are in the Controls.Primitives namespace:
Style:
Converter:
Converter instance: