如何获取WPF Datagrid与单元格包装文本而不是截断? [英] How get a WPF Datagrid with cells that wrap text instead of truncating it?

查看:158
本文介绍了如何获取WPF Datagrid与单元格包装文本而不是截断?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



现在,如果文本较大且不适合使用,则需要做什么才能获取包含文本的单元格的WPF Datagrid?一个colum文本被截断,用户看不到它的值cos Datagrid的IsReadOnly属性为true。我想要的是,单元格中的文本被包装,单元格高度(NO CELL WIDTH)增加了显示所有文本所需的数量。



提前感谢。
Frank Abel

解决方案

您可以尝试使用 TextBlock 其中启用了文本包装。


What must be done to get a WPF Datagrid with cells that wrap text instead of truncating it?

Right now when a text is bigger and don't fit in a colum the text is truncated and users can't see it value cos the Datagrid's IsReadOnly property is true. What I want is that the text in cells be wrapped and the cell height (NO CELL WIDTH) increased the amount needed to show all the text.

Thanks in advance. Frank Abel

解决方案

You could try to template the cells with a TextBlock which has text-wrapping enabled.

这篇关于如何获取WPF Datagrid与单元格包装文本而不是截断?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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