473,385 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to subclass a treeview control

How can I subclass a treeview control to add columns to it?

Thanks,
Alexis
Nov 20 '05 #1
5 2329
Cor
Hi Alexis,
How can I subclass a treeview control to add columns to it?


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
Nov 20 '05 #2
* is******@yahoo.com (Alexis) scripsit:
How can I subclass a treeview control to add columns to it?


That's not even supported by the underlying API.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet/>
Nov 20 '05 #3
"Cor" <no*@non.com> wrote in message news:<O3**************@TK2MSFTNGP10.phx.gbl>...
Hi Alexis,
How can I subclass a treeview control to add columns to it?


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


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.
/Alexis
Nov 20 '05 #4
Hi,

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

Ken
-----------------------
"Alexis" <is******@yahoo.com> wrote in message
news:b2**************************@posting.google.c om...
How can I subclass a treeview control to add columns to it?

Thanks,
Alexis

Nov 20 '05 #5
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
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:<u#**************@TK2MSFTNGP11.phx.gbl>...
Hi,

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

Ken
-----------------------
"Alexis" <is******@yahoo.com> wrote in message
news:b2**************************@posting.google.c om...
How can I subclass a treeview control to add columns to it?

Thanks,
Alexis

Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: SoKool | last post by:
Can anyone point me to a site where I can get a free treeview control to use in ASP .NET or any tutorial that can help me build my own treeview control. I intend to use a treeview to generate a...
8
by: Hrvoje Voda | last post by:
What is wrong in this code? private void tree_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == Keys.Enter ) {
0
by: Booshmon | last post by:
Hello Everybody, I'm trying to develop an interesting ASP.Net 2.0 application which uses the TreeView. I've got a number of different node-types from a laundry list of places with a laundry list...
3
by: Peter | last post by:
Hello, We are inserting a side menu to our application using a class that is writing HTML on all our pages. This is a part of the code as an example: writer.Write(" <table WIDTH=""100%""...
4
by: Ben Coats | last post by:
Hey, I'm trying to find code for an Explorer-style Directory ComboBox. (You know, it display "Desktop", "My Computer", all drives, etc., but it has a treeview control inside the combobox so that...
10
by: p3t3r | last post by:
I have a treeview sourced from a SiteMap. I want to use 2 different CSS styles for the root level nodes. The topmost root node should not have a top border, all the other root nodes should have a...
1
by: musosdev | last post by:
Hi guys I was using the Microsoft.Web.UI.WebControls extra namespace in my application to provide me with a TreeView control. I was using specifically ..GetNodeFromIndex(), SelectedNodeIndex and...
0
by: noneya22 | last post by:
I want to use a TreeView control as a one-level, vertical navigation menu. I'm using this control currently with a SiteMapDataSource and .sitemap file. I've written code that associates an image...
0
by: jiing | last post by:
Hi all, I want to use sting(the same as Node.Text) to judge if a node exists in TreeView. I've tried several ways, but seems all failed. could anybody help me? Thanks in advance. //My...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.