Newline character in datagrid cell

  • Thread starter Thread starter Billy Jacobs
  • Start date Start date
B

Billy Jacobs

I posted this before but the person who answered it
obviously completely misunderstood what I was talking
about.

I have a datagrid which is bound to a dataset table that
I generate programatically. In one of the fields in the
datasets' table, I am creating a string which has newline
characters like the following.

sb.append(dr.StartTime)
sb.append("-")
sb.append(dr.EndTime)
sb.append(vbnewline)
sb.append(dr.Activity)

newDR.Itinerary = sb.tostring
ds.WeeklyReport.Rows.Add(newDR)

Unfortunately when the datagrid is displayed in I.E. the
newline characters are ignored.

Instead of showing:
7:00 AM - 10:00 AM
My Activity Text

I get:
7:00 AM - 10:00 AM My Activity
Text

or somehting similar.

I have also tried chr(13) instead of vbnewline.

Is there anyway to force a newline in the cell of a
datagrid?

Billy Jacobs
 
Hi Billy,

You should add "<br/>" to add a newline in the datagrid cell, for example:
sb.append("<br/>")

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.
 
Back
Top