Displaying HTML Code in DataGrid....

L

LamSoft

I have a cell in the datagrid, which the original data is as following:

Testing1
Testing2
Testing3
Testing4

There are 4 lines, while it displays on the browser, it shows as a line, and
I tried to replace "\r\n" to <br/>, but the smart ASP helps me to translate
<br/> into &quot;&lt;br/&gt; , so the <br/> is useless here.... How can I do
if the data is more than 1 line? Thanks.
 
L

LamSoft

Sorry, 1 more thing

How can I set HTMLEncode=false in the coding

GridView.Columns[1].HTMLEncode = false

but i cannot find any attributes about HTMLEncode under GridView.Columns

Thanks.
 
G

Guest

HtmlEncode is a BoundField property - so any column that inherits from will
support this attribute, but not the Columns collection

LamSoft said:
Sorry, 1 more thing

How can I set HTMLEncode=false in the coding

GridView.Columns[1].HTMLEncode = false

but i cannot find any attributes about HTMLEncode under GridView.Columns

Thanks.



Sergey Poberezovskiy said:
try to set HtmlEncode="false" on your column (and use <br/>)
 
L

LamSoft

OH...
Thank you very much.
Sergey Poberezovskiy said:
HtmlEncode is a BoundField property - so any column that inherits from
will
support this attribute, but not the Columns collection

LamSoft said:
Sorry, 1 more thing

How can I set HTMLEncode=false in the coding

GridView.Columns[1].HTMLEncode = false

but i cannot find any attributes about HTMLEncode under GridView.Columns

Thanks.



"Sergey Poberezovskiy" <[email protected]>
wrote
in message news:[email protected]...
try to set HtmlEncode="false" on your column (and use <br/>)

:

I have a cell in the datagrid, which the original data is as
following:

Testing1
Testing2
Testing3
Testing4

There are 4 lines, while it displays on the browser, it shows as a
line,
and
I tried to replace "\r\n" to <br/>, but the smart ASP helps me to
translate
<br/> into "<br/> , so the <br/> is useless here.... How can I do
if the data is more than 1 line? Thanks.
 
M

Masudur

I have a cell in the datagrid, which the original data is as following:

Testing1
Testing2
Testing3
Testing4

There are 4 lines, while it displays on the browser, it shows as a line, and
I tried to replace "\r\n" to <br/>, but the smart ASP helps me to translate
<br/> into &quot;&lt;br/&gt; , so the <br/> is useless here.... How can I do
if the data is more than 1 line? Thanks.


Hi

did you tried replacing \r\n with environment.newline....?

Md. Masudur Rahman ( Munna )
Kaz Software Ltd.
http://www.kaz.com.bd
http://munnacs.110mb.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,602
Members
45,185
Latest member
GluceaReviews

Latest Threads

Top