本文介绍了反转WPF GridView将项目绑定到列而不是行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一种简单的方法来反转WPF ,以便项目绑定到列而不是行?或者是否有必要?如果你想用简单的值显示3列,然后用数据集合作为itemssource显示最后一列,那么你可以在最后一个单元格内放置一个网格并将其变形90度。
这是一种方式,同时也提高了性能,因为添加和渲染列比将行添加到网格要慢很多。
Is there a simple way to invert a WPF GridView
so that items are bound to columns instead of rows? Or would it be necessary to write a custom view mode?
解决方案
If you would like to show 3 columns with simple values, and then a last column with collection of data as itemssource, then you can put a grid within the last cell and trasform it 90 degrees.
This is the way, and also gives a performance improvement as adding and rendering columns is much slower than adding rows to a grid.
这篇关于反转WPF GridView将项目绑定到列而不是行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!