将 WPF DatGrid 绑定到二维数组
我在数据绑定方面有一个小问题,事实上我有一个 WPF 项目,其中有一个 DataGrid 控件,我想将其绑定到二维数组,尝试使用 datacontext 直接绑定,但它不起作用,它一直显示错误告诉我该数组不是一维的,任何人都可以告诉我该怎么做吗?谢谢
I have a little problem concerning databinding, infact I have a WPF project where I have a DataGrid Control that I want to bind to a two dimensional array, tried to bind dirrectly using datacontext but it didn't work, it showed all the time an error telling me that the array is not one dimensional, can any one show me how to do ? thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这两个问题可能对您有帮助:
如何将 WPF DataGrid 绑定到可变数量的列?
以编程方式添加列和行行到 WPF Datagrid
您需要将数组的一个维度“转换”为列,并将另一个数组维度用作行。
Those two questions might help you:
How do I bind a WPF DataGrid to a variable number of columns?
programmatically add column & rows to WPF Datagrid
You need to 'transform' one dimension of array to columns and use the other array dimension as rows.