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

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 4136
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
0
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,...

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.