Home All Groups Group Topic Archive Search About
Author
13 Mar 2005 9:59 AM
hannes
hello to all,

how to get an line break from a database to the datagrid?

thanks,
hannes

Author
13 Mar 2005 1:48 PM
Riki
hannes wrote:
> hello to all,
>
> how to get an line break from a database to the datagrid?
>
> thanks,
> hannes

You didn't say in which language. I'm using VB.NET here.

Turn AutoGenerateColumns off. Add BoundColumns instead.
For the column that has line breaks, convert the BoundColumn
to a TemplateColumn.
In the TemplateColumn replace
<%# DataBinder.Eval(Container.DataItem,"myField") %>
with
<%#
DataBinder.Eval(Container.DataItem,"myField").ToString().Replace("vbCRLF","<br>")
%>

--

Riki