帮助自定义datagridview行 [英] Help customizing datagridview row

查看:72
本文介绍了帮助自定义datagridview行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在应用程序中有一个数据网格视图,正在处理该数据网格视图,该视图需要将特定信息保存在一行中,当我尝试添加它时,我在以我想要的方式显示文本时遇到了问题.

我需要该行的一列中的文本如下所示:
<标题>
< email @ .com>

当我尝试添加它时,我只会得到一行文字< Title>< email @ .com>.我正在尝试像下面的代码一样添加它:

I have a data grid view in my application im working on that needs to hold specific information in a single row and when i try to add it i have issue with it displaying the text the way i want it.

I need the text in one column of the row to look like the following:
<Title>
<email@.com>

When i try to add it i just get a single line of text <Title><email@.com>. Im trying to add it like the below code:

Dim Rinfo As String = fName & vbCr & fEmail
DataGridView1.Rows.Add(Rinfo)



如果有人可以帮助我指出正确的方向,如何自定义真正有用的单元格中的文本.



If someone can help point me in the right direction on how to customize the text in a cell that would really help.

推荐答案

在属性中打开"DefaultCellStyle"并将"WrapMode"设置为true

并使用vbCrLf或vbNewLine进行换行,而不是vbCr.
Open ''DefaultCellStyle'' in the properties and set ''WrapMode'' to true

And use vbCrLf or vbNewLine for a line break, not vbCr.


这篇关于帮助自定义datagridview行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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