Groups | Blog | Home
all groups > vb.net controls > february 2004 >

vb.net controls : How to subclass a treeview control


is4fun2k NO[at]SPAM yahoo.com
2/25/2004 9:40:15 PM
How can I subclass a treeview control to add columns to it?

Thanks,
Cor
2/26/2004 8:41:51 AM
Hi Alexis,

[quoted text, click to view]

I think this is to much a riddle to get a real answer.

You have to describe it something furter what your want (what is the
subclass) and wherefore it should be a subclass?

Cor

hirf-spam-me-here NO[at]SPAM gmx.at
2/26/2004 11:01:11 AM
* is4fun2k@yahoo.com (Alexis) scripsit:
[quoted text, click to view]

That's not even supported by the underlying API.

--
Herfried K. Wagner [MVP]
is4fun2k NO[at]SPAM yahoo.com
2/26/2004 11:04:07 AM
[quoted text, click to view]

Ok,
The treeview control has a treenode collection and each treenode has a
Text property which is an "String". This text (string) is all the
information the treenode will display, right? I want to display the
text in multiple colums like the ListView control does in the Details
view.

This is what I did.

I subclassed a TreeNode object and change the Text (String) Object to
a ListViewItem Object. I can then add and get information to/from the
SubItems (columns) of the ListViewItem (Now part of the TreeNode) but
the Tree control does not display the ListViewItem.

So basically I'm trying to combine a ListViewItem and a TreeNode to
make a Tree with multiple columns. I saw in another news group this
combination referred as a TreeList

I know there are some third party treeview that display columns, but
I'm not allow to add third party control to this project. The fact
that others had done it also tells me that it is possible.

If subclassing is not the best way, is there a better way? APIs? I
would like to use an object oriented approach.

Thanks in advance.
Ken Tucker [MVP]
2/27/2004 2:10:54 PM
Hi,

TreeListView control ?
http://www.codeproject.com/cs/miscctrl/treelistview.asp

Ken
-----------------------
[quoted text, click to view]

is4fun2k NO[at]SPAM yahoo.com
3/1/2004 12:01:10 PM
Thank you.
That's what I was looking for. Well I was hoping to find something
simpler. But great job. I'll look at it in more details. Thanks


[quoted text, click to view]
AddThis Social Bookmark Button