473,513 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying paths as a directory tree using Treeview

JSM
Hi,

I have been racking my brain over this one for a couple of days and have
finally given up. I am currently converting a project from VB6 to C#. I have
a list of paths in a database which I want to display as a folder tree in a
tree view.

The paths are in the format of :

\
\Folder1\
\Folder1\SubFolder1a\
\Folder2\
\Folder2\SubFolder2a\
\Folder2\SubFolder2b\
\Folder2\SubFolder2b\SubFolder2ba\

etc etc (folder names are only examples)

I did this quite easily in VB because I could specify a tree node's parent
by using it's key (which I had set to equal the node's path), however since
treenodes don't use keys anymore and you can only directly access a node
using it's index I am at a loss how I can do this.

Has anybody done something similar in C#? If not - any ideas on how I would
do this?

Any help will be appreciated.

Cheers,

John


Nov 16 '05 #1
1 4142
JSM
don't worry - after much soul searching and heartache I finally figured it
out.
"JSM" <js*@sirotilk.com.au> wrote in message
news:ek**************@TK2MSFTNGP09.phx.gbl...
Hi,

I have been racking my brain over this one for a couple of days and have
finally given up. I am currently converting a project from VB6 to C#. I have a list of paths in a database which I want to display as a folder tree in a tree view.

The paths are in the format of :

\
\Folder1\
\Folder1\SubFolder1a\
\Folder2\
\Folder2\SubFolder2a\
\Folder2\SubFolder2b\
\Folder2\SubFolder2b\SubFolder2ba\

etc etc (folder names are only examples)

I did this quite easily in VB because I could specify a tree node's parent
by using it's key (which I had set to equal the node's path), however since treenodes don't use keys anymore and you can only directly access a node
using it's index I am at a loss how I can do this.

Has anybody done something similar in C#? If not - any ideas on how I would do this?

Any help will be appreciated.

Cheers,

John

Nov 16 '05 #2

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

Similar topics

1
2047
by: jnc | last post by:
Hi, I was wondering if anybody had any pointers on the following: I need to write some code which takes a list of file paths and transforms them into a treeview which shows the directory...
11
3586
by: BoonHead, The Lost Philosopher | last post by:
I think the .NET framework is great! It's nice, clean and logical; in contradiction to the old Microsoft. It only saddens me that the new Microsoft still doesn't under stand there own...
5
2495
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to...
1
847
by: JSM | last post by:
Hi, I have been racking my brain over this one for a couple of days and have finally given up. I am currently converting a project from VB6 to C#. I have a list of paths in a database which I...
2
1546
by: Reddy | last post by:
Hi!, IE web COntrols are working perfectly on my local system. But when i moved to production server. That tree is not looking as it supposed to be. I don't know why? It has that dll in the bin...
15
22289
by: Jameson | last post by:
Happy New Year, Everyone! I am trying to figure out how to display a bunch of images (mainly JPEGs, but possibly a few GIFs and PNGs as well) that are stored in a local directory on the system....
0
2170
by: saravanaVijayakumar | last post by:
I'm new to xml .. I had created a application such a way that I have to display the xml file in treeview control in C#.Net Application ... If I select the particular Node it should display the...
1
1793
by: NJP | last post by:
Hi Guys, I have a simple treeview on my webform (C# 2.0). I am dynamically populating the treeview with nodes. On my leaf nodes i want to have text seperated by a large amount of blank space...
3
1156
by: BW | last post by:
We have a directory on our network where we keep pictures for all of our customers. They utilize a directory structure to keep them organized. I would like to have the clients be able to log onto...
0
7260
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
7384
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
7539
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...
1
7101
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...
0
5686
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,...
0
4746
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...
0
3234
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...
0
3223
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1597
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 ...

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.