How to display multiple lines of text on a treenode in treeview?

How to display multiple lines of text on a treenode in treeview (using C# in asp.net)?
treehouse2008Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tiagosalgadoCommented:
You can use <br /> to do that.

<asp:TreeNode Text="This is a<br /> Multiline text node" Value="This is a Multiline text node"></asp:TreeNode>
0
treehouse2008Author Commented:
I use treeview to display XML. If I insert <br /> into the text, <br /> is viewed as a XML node, then the real text is filtered out and is not displayed.
0
tiagosalgadoCommented:
Try to encode < and > characters. Put #lt;br /#gt; (replace # to &)
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

treehouse2008Author Commented:
I tried to put <br /> , the node is just displayed as <br />aaa<br />ccc<br />, not change lines.
0
treehouse2008Author Commented:

I tried to put  "#lt;br /#gt; (replace # to &)" , the node is just displayed as <br />aaa<br />ccc<br />, not change lines.
0
ReecioCommented:
Wow, talk about over complicate things...... TreeView1.NodeWrap = true (is it == in C#? I'm using VB tbh).
Then the node will write on multiple lines but only stretch as far the width of the control.
0
treehouse2008Author Commented:
I did not find NodeWrap property in TreeView. Is there anything wrong with what I did?
0
treehouse2008Author Commented:
I'm using Windows Application. Not Web Application.
0
ReecioCommented:
Sorry, been away for a while.....

Your question states how to wrap text on a treeview in asp.net? Anyways, I'll add my answer as if you were writing a forms app.

If you're writing using forms, there is no wrap property in the default treeview, as you have stated. You may want to look at some Extended controls (controls people have adapted to add functionality), one that may assist can be found here: http://www.altavim.com/Products/Extended-TreeView/default.aspx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tina karCommented:
Hi
I am finding solution for RADTreeview Text can be come in new line after certain size of Text .
Please give some solution
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.