views:

2186

answers:

2

Is it possible (by using the stock c# TreeView) to have Multiline TreeNodes?

Also, is it possible to add control characters to TreeNode's text e.g. '\t'? This same effect could also be achieved by adding columns to the TreeNode. is this possible?

+2  A: 

I do not believe this is possible using WinForms, at least without drawing your own nodes. You may be able to use an "owner-drawn" treenode to accomplish this in WinForms, though, I don't know.

This is natively supported with WPF, though.

Dave Markle
+1  A: 

It isn't very clear from your question whether you are on ASP.NET or WinForms. If you're in ASP.NET you could try using the PRE tag to get formatting...?

What that's said the Ra-Ajax TreeView which you can see an example of here can have any arbitrage amount of HTML and/or even controls within it which mostly makes it way superior to the built in TreeView in ASP.NET. (Disclaimer; I Work with Ra-Ajax)

This makes it possible for you to format the contents of the TreeView exactly as you wish. Though if you go completely berserk you still run the risk of creating "display artifacts" due to too much space or something like that...

Thomas Hansen