Solved

Linefeed character in a datagrid

Posted on 2006-07-10
2
296 Views
Last Modified: 2008-02-01
Does anyone know how I can get the linefeed/carriage return character to appear in a datagrid.  When I bind to a string column (in a SQL Server table) that has text that includes the linefeed character the text displayed in the datagrid cell appears as one continues text stream, without the linefeeds.

Thanks
0
Comment
Question by:nicksbell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 250 total points
ID: 17072410
Hi nicksbell,

Replace the linefeed/cr with <br>. The datagrid is displayed as html so you need to use the html breaking line tag.

In your itemdatabound event, or even in the select statement use a replace statement to convert the vbCrLf to <BR>

Tim Cottee
0
 
LVL 2

Author Comment

by:nicksbell
ID: 17073164
yes, that did the trick.  I just included replace(text,char(10),'<BR>') in my select statement.

Thanks
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question