473,385 Members | 1,925 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,385 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 4134
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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...

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.