且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用绑定动态地将列添加到DataGrid

更新时间:2023-10-04 23:39:16

您是否有使用DataGrid的具体原因?



数据的设计方式,我认为< ItemsControl>将有助于获得您正在寻找的网格。你可以使用< UniformGrid>会导致所有''节点''大小相同的元素。



有一个使用< ItemsControl>的示例和< UniformGrid> 此处 [ ^ ]
Do you have a specific reason for using a DataGrid?

The way your data is designed, I would think an <ItemsControl> would serve to get the grid you are looking for. You could use a <UniformGrid> element which would cause all of the ''nodes'' to be the same size.

There is a sample of using <ItemsControl> and <UniformGrid> here[^]