Click here to Skip to main content
16,016,613 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

VB
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.
Posted

1 solution

Open 'DefaultCellStyle' in the properties and set 'WrapMode' to true

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900