473,606 Members | 2,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with a TreeView

DJG
I need some help with a TreeView control in VB.Net

I've got a datatable with about 8000 rows. 500 are 'folders', and the
other 7500 rows are 'jobs'. It's a logical representation of some data,
and not a physical drive.

Each row has:
master_key (unique id)
folder_name (name for the user to see)
parent_key (the master_key of the parent folder)
other fields.....

The folder names are NOT unique.

I want to display a treeview, and allow the user to select a folder
where I will place a new 'job'.

I can figure out how to place all the nodes on the tree (I'm not sure if
I'm just going to display the folders, or each job yet). But I'm having
a hard time figuring out how to find out the unique folder that the user
selects.

Since it looks like TreeView nodes are all zero based indexes, and each
node starts over at zero, I can't figure out how to select the exact
folder to place the new job. I cannot use the master_key as the folder
name (it's 36 characters alphanumeric with no logic to the user), and I
can't insert it as any kind of index.

So it looks like I either have to:

1. Take the FullPath of the folder selected, and query my way backwards
through the table to figure out the master_key of the row the user
selected, or...

2. I saw something in HELP about how the TreeView could display
'objects' that tagged out to a name a user would understand. I'm not
real familiar with using objects that way (or any way really), but I
assume I would create a collection of custom objects that included both
the folder namd and the master_key. The folder name would be displayed
on the TreeView, while I could use the master_key selected for the rest
of my application.

Have I got this right? Or am I missing something really obvious here?

Thanks in advance for any help. P.S. - I'm new at this, so please talk
very s-l-o-w-l-y in your response ;-)

DJG

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
2 1540
VJ

"DJG" <an*******@devd ex.com> wrote in message
news:%2******** **********@TK2M SFTNGP12.phx.gb l...
I need some help with a TreeView control in VB.Net

I've got a datatable with about 8000 rows. 500 are 'folders', and the
other 7500 rows are 'jobs'. It's a logical representation of some data,
and not a physical drive.

Each row has:
master_key (unique id)
folder_name (name for the user to see)
parent_key (the master_key of the parent folder)
other fields.....

The folder names are NOT unique.

I want to display a treeview, and allow the user to select a folder
where I will place a new 'job'.

I can figure out how to place all the nodes on the tree (I'm not sure if
I'm just going to display the folders, or each job yet). But I'm having
a hard time figuring out how to find out the unique folder that the user
selects.

Since it looks like TreeView nodes are all zero based indexes, and each
node starts over at zero, I can't figure out how to select the exact
folder to place the new job. I cannot use the master_key as the folder
name (it's 36 characters alphanumeric with no logic to the user), and I
can't insert it as any kind of index.

So it looks like I either have to:

1. Take the FullPath of the folder selected, and query my way backwards
through the table to figure out the master_key of the row the user
selected, or...

2. I saw something in HELP about how the TreeView could display
'objects' that tagged out to a name a user would understand. I'm not
real familiar with using objects that way (or any way really), but I
assume I would create a collection of custom objects that included both
the folder namd and the master_key. The folder name would be displayed
on the TreeView, while I could use the master_key selected for the rest
of my application.

Have I got this right? Or am I missing something really obvious here?

Thanks in advance for any help. P.S. - I'm new at this, so please talk
very s-l-o-w-l-y in your response ;-)

DJG

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #2
VJ
I am assuming here you build the treeview from the datatable..when you do so
at the time of creation of your folders (or treenodes), you can specify a
unique tag for each node.. TreeNode.Tag is I believe the property. This
should make your folders unique even if they have the same text

VJ
"DJG" <an*******@devd ex.com> wrote in message
news:%2******** **********@TK2M SFTNGP12.phx.gb l...
I need some help with a TreeView control in VB.Net

I've got a datatable with about 8000 rows. 500 are 'folders', and the
other 7500 rows are 'jobs'. It's a logical representation of some data,
and not a physical drive.

Each row has:
master_key (unique id)
folder_name (name for the user to see)
parent_key (the master_key of the parent folder)
other fields.....

The folder names are NOT unique.

I want to display a treeview, and allow the user to select a folder
where I will place a new 'job'.

I can figure out how to place all the nodes on the tree (I'm not sure if
I'm just going to display the folders, or each job yet). But I'm having
a hard time figuring out how to find out the unique folder that the user
selects.

Since it looks like TreeView nodes are all zero based indexes, and each
node starts over at zero, I can't figure out how to select the exact
folder to place the new job. I cannot use the master_key as the folder
name (it's 36 characters alphanumeric with no logic to the user), and I
can't insert it as any kind of index.

So it looks like I either have to:

1. Take the FullPath of the folder selected, and query my way backwards
through the table to figure out the master_key of the row the user
selected, or...

2. I saw something in HELP about how the TreeView could display
'objects' that tagged out to a name a user would understand. I'm not
real familiar with using objects that way (or any way really), but I
assume I would create a collection of custom objects that included both
the folder namd and the master_key. The folder name would be displayed
on the TreeView, while I could use the master_key selected for the rest
of my application.

Have I got this right? Or am I missing something really obvious here?

Thanks in advance for any help. P.S. - I'm new at this, so please talk
very s-l-o-w-l-y in your response ;-)

DJG

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #3

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

Similar topics

2
1771
by: Bonj | last post by:
Hello Can anyone assist with the following class hierarcy problem? I have a series of window classes, the object model currently being as such: Window / | \ / | \ MDIClientWindow | TreeViewWindow WndProcWindow / \
2
2764
by: Peter Flickinger | last post by:
I have been using a label with the TreeView control - to simulate the ghost image of a node during drag/drop (so that a ghost of the node appears to be floating next to the cursor on a drag/drop). This works peachy when I had a form that used the TreeView control (from Microsoft). The time came that I needed to change the TreeView - so I created a control that inherited from the TreeView class.
0
2412
by: Norbert Heidbüchel | last post by:
Hi all, I have read a lot of postings and web pages about drag and drop and treeviews, but could not find an answer to my problem. Sorry, if I missed something. I am trying to drag and drop treenodes defined by myself and don't understand, how to get the nodes data in the dragdrop event. I'm not very experienced in .NET and for sure there is a simple solution. I've written a short sample program, based on well known examples,
1
315
by: Jigar Shah | last post by:
hello i want to make a forum in my site which shows message posts and its total replies. So i had put treeview (IE Web Controls) in datagrid. I need help for that. I am attaching events to treeview using delegates. But i still not found proper result Pls help me. i need it immediatel
14
15074
by: Mr.D | last post by:
How do I save/load the contents of a Treeview to a file? I have found several good examples written i VB6, but not a single one for VB.NET. Please help. ---- Tim
0
1772
by: Treeview Trouble | last post by:
I have an application where there are two radio buttons each of which populates a treeview control with a directory structure. Each radio button corresponds to a different directory which may or may not have some subdirectories with the same name. I am not having any problems populating the treeview with the corresponding directory structure when switching between radio buttons. In the treeview's AfterSelect event, I take the path from...
1
1863
by: pooja | last post by:
i need to implement drag and drop in treeview in VB. Kindly help. My treeview contains activities maintained using XML Files. Hopefully, Thanks.
2
1614
by: engwar1 | last post by:
I'm a .Net newbie and have started writing a Windows Forms application to assist me in choosing files/directories to move from one drive to another. Basically what I want is something like the TreeView control and have the following questions. + I'm not sure if it's possible to include a checkbox control as part of a TreeView. Do I need to use images of a checkbox in my ImageIndex property? I'd imaging I'd need 4 images of directories...
7
9685
by: tman | last post by:
I am generating a very large tree list in my program and while it's performance is great once loaded it takes a really long time to load. I create a root TreeNode "offline" and go through the process of creating building up the tree from there. Only when I am done do I go over to the actual TreeView object on my form and add the my root to the TreeView. This sinlge step when I add my constructed root node to the form's TreeView control...
0
8430
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8305
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6770
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5465
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3930
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2448
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1553
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1296
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.