473,743 Members | 2,243 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 1546
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
1777
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
2769
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
2418
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
15096
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
1778
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
1881
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
1625
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
9696
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
8970
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8795
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9344
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...
1
9277
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9214
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...
1
6763
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6057
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
4827
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.