473,671 Members | 2,430 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\SubFol der1a\
\Folder2\
\Folder2\SubFol der2a\
\Folder2\SubFol der2b\
\Folder2\SubFol der2b\SubFolder 2ba\

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 4169
JSM
don't worry - after much soul searching and heartache I finally figured it
out.
"JSM" <js*@sirotilk.c om.au> wrote in message
news:ek******** ******@TK2MSFTN GP09.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\SubFol der1a\
\Folder2\
\Folder2\SubFol der2a\
\Folder2\SubFol der2b\
\Folder2\SubFol der2b\SubFolder 2ba\

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
2061
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 structure of the file paths. Cheers.....Jim
11
3627
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 rules when it comes to file paths. A lot of Microsoft installers for example, and also installers of other companies, do not work because they handle paths in the following manner:
5
2506
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 very carefully define the order in which paths are searched with command line options on the compiler. Both can cause problems, especially when dealing with complex software distributions. It occurs ot me that by extending the C include...
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 want to display as a folder tree in a tree view. The paths are in the format of : \
2
1552
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 folder, It displaying just text, not hyperlinks and buttons everything. My Production server is on different domain..from my system. I am uploading the project to the using the project copy of Visual Studio.NET. This is working fine when i moved my...
15
22308
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. I can do this with the glob() function, but I can't seem to put in a directory other than one within the webroot. For example, I can only put "/uploads" and not "/Volumes/jray/Pictures...". Any ideas how to get around this? If I can't use the...
0
2182
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 attributes of that node in DataGrid But I am displaying the attributes in dataGrid if i use the following Code XmlNode x = root.SelectSingleNode("//JDF")
1
1795
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 like shown below Name BirthDay Photograph
3
1162
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 a webpage and view their files. What is the best way to accomplish this? Each client could have several subdirectories below them. Thanks BW
0
8400
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
8924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8602
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
7441
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5702
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
4227
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2817
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 we have to send another system
2
2058
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.