473,587 Members | 2,524 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 4163
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
2059
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
3614
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...
5
2502
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...
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
1550
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...
15
22300
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...
0
2178
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 = ...
1
1794
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
1161
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
7918
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
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...
0
8340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
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...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
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...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2353
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
0
1185
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...

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.