wrapping text in a datagrid cell

R

Roy H. Berger

I have a datagrid that I am having text wrapping problems with. And
the wrapping problems only happen with text containing long urls. If
I set the column width to a fixed width through the ItemStyle-Width
property in the ASPX file, the text above and below the url honor that
fixed setting. Also, I have set the Wrap=True property both on the
datagrid as well as the column. So if you have the following:

This is a test. This is a test. This
is a test. This is a test. This is
a test. This is a test.

http://www.someurl.com/a/...........................................


This is a test. This is a test. This
is a test. This is a test. This is
a test. This is a test.

The text above and below the url honor whatever width setting I
select. However the long url (like a link to a mapquest map), causes
the width of the cell to extent out beyond the right edge of the page.
Nothing I do seemes to force the hrl to wrap within the cell. I
could brute force the rendering of the text contents of the cell and
break the lines after so many characters, but inserting a <br> into
the url would break the url.

Any thoughts on this problem would be appreciated.

Thanks in advance.

Roy

(e-mail address removed)
 
R

Roy Berger

Actually, I neglected to mention -- I am outputting this url as a
hyperlink (<a href....., etc.). When I render the text in the cell on
the fly, I call a method in my codebehind to 1) convert CRLF pairs to
<br>'s; 2) scan the text for any URLS and convert them to hyperlinks.
Even doing that causes the cell to be the width of the URL.

Sorry I did make that clear in the original post.

Roy
 
E

Eliyahu Goldin

just guessing... may be you could output the url not as a text but as a
hyperlink html... then you can break the link text as you wish, it won't
effect the url.

Eliyahu
 

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,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top