views:

496

answers:

2

Despite my google efforts, I could not find a solution to use a default .NET treeview and have variable height for each node in that tree view.

I need is a way to have 2 types of node with different heights.

Ideally, I would also like that one node type can also become bigger as the mouse hover it.

Any clever guy around? :)

+1  A: 

That is not possible with the System.Windows.Forms.TreeView nor with any 3rd party replacement I'm aware of. The capabilities of the standard treeview are right about those shown in the Windows Explorer folder view.

Maybe you want to give us some more information about your task or goal. This would allow us to point you to some other alternatives.

Of course, you can always implement you own tree view, but with your requirements this can become a quite time consuming task, I think.

Frank Bollack
Great... I'm already doing a custom drawing. I'd like to do a simple list with 2 level hierarchy. 1 for group (small header) and 1 for items in it (twice bigger). I tried with list view, gave up as you had no variable size, then I tried with List box and managed to have something working, but code to collapse/expand group is not great as I manage the add/remove myself, so I'm trying with tree view that would do what I want but doesn't have variable item length. What a pain :)
Jeremy
+1  A: 

I didn't find an answer to your question. @Frank is right about this not being possible in WinForms.

However, Microsoft design guidelines offer some alternatives to TreeViews IF your hierarchy is only two levels deep.

http://msdn.microsoft.com/en-us/library/aa511496.aspx

David Stratton
+1: Thats a very intersting link.
Frank Bollack