将文本包装到DataGridView单元格中的新行
下午好!
DataGridView列具有以下文本:
(dep) |
---|
程序员(it InfrastComcture) |
程序员(INFRASTCOCTURE) |
系统管理员(INFRASTCOCTURE) |
程序员(INFRASTCOCTURE)工程师(INFRRASTCOCTURE) |
工程师(INFRRASTCOCTURE) |
系统管理员(INFRASTCOCTURE) |
title DataGridView设置为:
DataGridView1.RowTemplate.Height = 44
告诉我,如何将包含在括号中的测试移动到单元格中的新行?
DataGridView列中的所有单元格应该看起来像这样:
programmer
IT infrastcomcture
您当然可以这样做:
DataGridView1.Columns(2).DefaultCellStyle.WrapMode = DataGridViewTriState.True
DataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
但是此代码无法正常工作。我希望,无论列的宽度如何,括号中指示的文本都会转移到单元格中的新线路
Good afternoon!
The DataGridView column has the following text:
Title (Dep) |
---|
programmer (IT infrastcomcture) |
programmer (IT infrastcomcture) |
System Administrator(IT infrastcomcture) |
programmer (IT infrastcomcture) |
engineer(IT infrastcomcture) |
System Administrator(IT infrastcomcture) |
The height of the rows in the DataGridView is set to:
DataGridView1.RowTemplate.Height = 44
Tell me, how can I move the test, which is contained in brackets, to a new line in the cell?
All cells in the Datagridview column should look like this:
programmer
IT infrastcomcture
You can of course do this:
DataGridView1.Columns(2).DefaultCellStyle.WrapMode = DataGridViewTriState.True
DataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
But this code won't work. I want that, regardless of the width of the column, the text that is indicated in brackets will be transferred to a new line in the cell
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论