如何设置的DataGridViewCell自动自动换行? [英] How to set the DataGridViewCell to automatically word wrap?

查看:179
本文介绍了如何设置的DataGridViewCell自动自动换行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面,我在MSN上找到的代码不工作,自动文字换行的单元格:

The code below which I found on MSN did not worked to automatically word-wrap a cell:

dataGridView.Columns.Items[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells

dataGridView.Columns.Items[0].DefaultCellStyle.WrapMode = DataGridViewTriState.true;



更​​多回答?

Any more answer?

推荐答案

您还需要设置 DataGridView.AutoSizeRowsMo​​de = DataGridViewAutoSizeRowsMo​​de.AllCells (以及你做了什么),用于自动换工作。

You also need to set DataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells (along with what you have done) for word-wrap to work.

这篇关于如何设置的DataGridViewCell自动自动换行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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