数据网格 +将列映射到结构字段
我正在尝试将数据网格(带有 WPF Toolkit 的 WPF C# 4.0)绑定到结构的字段。我基本上有一个包含两列的数据网格。第一个我想成为标签,第二个我想成为结构的成员。最好我想将这一系列行视为单个结构,然后可以在程序的其他地方使用它。
目前,我让程序为每一行添加某个类的新实例,但我更愿意将它们视为一个......有什么办法吗?
谢谢
I'm trying to bind a datagrid (WPF C# 4.0 with WPF Toolkit) to the fields of a structure. I basically have a datagrid with two columns. The first I would like to be labels, the second I would like to be the members of a structure. Perferably I would like to treat the series of rows as a single structure which can then be used elsewhere in my program.
Currently I have the program adding new instances of some class for each row, but I would prefer to treat it all as one... is there a way?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ViewModel
视图
将集合绑定到具有所需列的 DataGrid...
ViewModel
View
Bind the collection to DataGrid with required Columns...