?
Solved

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

Posted on 2008-11-19
12
Medium Priority
?
2,809 Views
Last Modified: 2016-09-17
How to display multiple lines of text on a treenode in treeview (using C# in asp.net)?
0
Comment
Question by:treehouse2008
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 8

Expert Comment

by:tiagosalgado
ID: 22993844
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
 

Author Comment

by:treehouse2008
ID: 22994316
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
 
LVL 8

Expert Comment

by:tiagosalgado
ID: 22994344
Try to encode < and > characters. Put #lt;br /#gt; (replace # to &)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:treehouse2008
ID: 22994580
I tried to put <br /> , the node is just displayed as <br />aaa<br />ccc<br />, not change lines.
0
 

Author Comment

by:treehouse2008
ID: 22994692

I tried to put  "#lt;br /#gt; (replace # to &)" , the node is just displayed as <br />aaa<br />ccc<br />, not change lines.
0
 
LVL 4

Expert Comment

by:Reecio
ID: 22994835
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
 

Author Comment

by:treehouse2008
ID: 22995018
I did not find NodeWrap property in TreeView. Is there anything wrong with what I did?
0
 

Author Comment

by:treehouse2008
ID: 22995044
I'm using Windows Application. Not Web Application.
0
 
LVL 4

Accepted Solution

by:
Reecio earned 2000 total points
ID: 23303179
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
 

Expert Comment

by:Tina kar
ID: 41802917
Hi
I am finding solution for RADTreeview Text can be come in new line after certain size of Text .
Please give some solution
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

621 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