反转WPF GridView将项目绑定到列而不是行 [英] Invert WPF GridView to bind items to columns instead of rows

查看:187
本文介绍了反转WPF GridView将项目绑定到列而不是行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法来反转WPF GridView ,以便项目绑定到列而不是行?或者是否有必要编写自定义视图模式

这是一种方式,同时也提高了性能,因为添加和渲染列比将行添加到网格要慢很多。

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将项目绑定到列而不是行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆