473,320 Members | 1,914 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,320 software developers and data experts.

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 1509
VJ

"DJG" <an*******@devdex.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
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*******@devdex.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
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
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 / | \ / | \...
2
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)....
0
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...
1
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...
14
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
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...
1
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
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...
7
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.