TreeView - Programming an Explorer-style Site View
page 1 of 1
Published: 09 Oct 2003
Unedited - Community Contributed
Abstract
This article details how to setup the IE Web Control's TreeView programmatically to display web folders in much the same way as Internet Explorer.
by Steve Sharrock
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 177660/ 212

The ASP.NET TreeView WebControl documentation includes examples that deal with the basics of the TreeView control, but it's hard to find many examples that show how to load the TreeView using programmatic methods in C#. The examples in this article create a familiar explorer-style tree containing all of the folders and specified files from within a web site, including navigation links from files appearing in the tree. The code presented here illustrates not only some of the TreeView methods and properties, but also a simple recursive method to browse directories and files on a web server.

I originally wrote this code for a client that had a large amount of HTML content organized in folders. This simple technique creates a dynamic tree-styled menu that automatically changes as contributing members add new folders and content files to the site.

The example includes the DocTree.aspx and DocTree.aspx.cs files presented below. The sample code creates the tree starting at this web sites root (shark), so you will see all the .aspx files in my site here at AspAllaiance.

Click to run demo now.

The DocTree.aspx file defines a simple table that contains the unadorned TreeView control on the left, and an <IFRAME> on the right used to show pages from links within the tree (.aspx file links, in this case). The TreeNodeTypes "folder" and "file" could be specified here in the .aspx file, but they are applied within the codebehind page during initialization instead to illustrate these methods. The IFRAME is only here to facilitate the example.

<form id="DocTree" method="post" runat="server">
  <table cellpadding="8" cellspacing="0" border="0" height="100%">
    <tr height="100%">
      <td valign="top">
        <iewc:TreeView id="TreeCtrl" runat="server" SystemImagesPath="/webctrl_client/1_0/treeimages/">
        </iewc:TreeView>
      </td>
      <td valign="top" width="100%" height="100%">
        <iframe id="doc" name="doc" frameborder="yes" scrolling="auto" width="100%" height="100%">
        </iframe>
      </td>
    </tr>
  </table>
</form>

We'll start looking at the DocTree.aspx.cs codebehind file's Page_Load method where the TreeView is first initialized. The first task is to create and add two TreeNodeType objects that represent both folders and files. I took a little shortcut here and hard-coded the path to my folder and file images.

After the TreeNodeType objects are added, I make a single call to the GetFolders method passing the root folder of my web site. I use the "~" reference and insure there is a "/" symbol following it. The MapPath method creates the server full path to my virtual directory. You'll see later on that I use the length of this path name to trim the full physical path when creating the TreeNode text and NavigationUrl. The final step here expands the tree a little for the initial viewing.

private void Page_Load(object sender, System.EventArgs e)
{
  if ( ! this.IsPostBack )
  {
    // add tree node "type" for folders and files
    string imgurl = "/shark/webctrl_client/1_0/Images/";
    TreeNodeType type;

    type = new TreeNodeType();
    type.Type = "folder";
    type.ImageUrl = imgurl + "folder.gif";
    type.ExpandedImageUrl = imgurl + "folderopen.gif";
    TreeCtrl.TreeNodeTypes.Add( type );

    type = new TreeNodeType();
    type.Type = "file";
    type.ImageUrl = imgurl + "html.gif";
    TreeCtrl.TreeNodeTypes.Add( type );

    // start the recursively load from our application root path
    //  (we add the trailing "/" for a little substring trimming below)
    GetFolders( MapPath( "~/./" ), TreeCtrl.Nodes );

    // expand 3 levels of the tree
    TreeCtrl.ExpandLevel = 3;
  }
}

All of the directory scanning and loading the TreeView nodes is performed in the recursive method GetFolders. Using the specified path, a string[] is populated with all of the the folders, and then another string[] is filled with the files in this path. For each directory in the list, we add a TreeNode object of type "folder", and for each file a node of type "file".

The last step is to look thru all of the nodes we just added, and recursively call GetFolders with the appropriate path and TreeNodeCollection.

private void GetFolders(  string path, TreeNodeCollection nodes )
{
  // add nodes for all directories (folders)
  string[] dirs = Directory.GetDirectories( path );
  foreach( string p in dirs )
  {
    string dp = p.Substring( path.Length );
    if ( dp.StartsWith( "_v" ) )
      continue; // ignore frontpage (Vermeer Technology) folders
    nodes.Add( Node( "", p.Substring( path.Length ), "folder" ) );
  }   

  // add nodes for all files in this directory (folder)
  string[] files = Directory.GetFiles( path, "*.aspx" );
  foreach( string p in files )
  {
    nodes.Add( Node( p, p.Substring( path.Length ), "file" ) );
  }   

  // add all subdirectories for each directory (recursive)
  for( int i = 0; i < nodes.Count; i++ )
  {
    if ( nodes[ i ].Type == "folder" )
    {
      GetFolders( dirs[ i ] + "\\", nodes[i ].Nodes );
    }
  }    
}

The final method (called from GetFolders) creates a TreeNode object from the specified path, node text, and node type. It's a little sleezy, but I use the full path, minus the length of the path that represents my physical "root" path to create the NavigateUrl. This does require that the physical path names match the virtual names in the NavigateUrl (from my root forward).

private TreeNode Node( string path, string text, string type )
{
  TreeNode n = new TreeNode();
  n.Type = type;
  n.Text = text;
  if ( type == "file" )
  {
    // strip off the physical application root portion of path
    string nav = "/" + path.Substring( MapPath( "/" ).Length );
    nav.Replace( '\\', '/' );
    n.NavigateUrl =  nav;
    // set target if using FRAME/IFRAME
    n.Target="doc";
  }
  return n;
}

Conclusion

Of course, this example has a few shortcuts, and could use some more work before use in a real-world application. However, the example shows some of the powerful System.IO directory and file methods, and the ease with which we can display hierarchical data, even without the more traditional XML used with the TreeView WebControl. As a converted C++ programmer, I prefer these new methods to the old familiar variations on FindFirstFile and FindNextFile. I also find it easy to use the node collections, rather than the familiar parent-child-sibling links used in some of the older Tree controls.

Downloads

You can download Doctree.zip if you want to use these two files and don't like to type.

Make sure you have the latest download of the Microsoft WebControls and that you have added a Reference to the controls within your application.

NEW Download

Thanks to Dana Coffey, you can now download DirectoryBrowser.zip, a complete Directory Browser sample application written in Visual Basic. The easiest way to use this download is to create a new Visual Basic ASP.NET project with Visual Studio named "DirectoryBrowser". Then unzip the files from this download into the web application folder created by Visual Studio--normally C\:Inetpub\wwwroot\DirectoryBrowser. Be sure and set the application start page to Browser.aspx, and you're ready to go.

You can visit Dana's web site at www.AspForBlondes.com. Many thanks to Dana for this translated download.

Steve Sharrock -   www.AspAlliance.com/shark

 



User Comments

Title: problem   
Name: tree view
Date: 2011-12-05 3:10:13 PM
Comment:
Hai i read u r article..it is good..
Can u help me to add nodes to tree from database...that up to 'n' level i want to add..if u have the code pls send to my email id mr.reddy341@gmail.com
Title: IE Browser Compatibly Issue   
Name: Shijin
Date: 2011-01-21 2:53:10 AM
Comment:
Hello Sir, It work perfectly in all browser except IE, Can you please give me some suggestion how to fix this?
Title: Select Node Method on Treeview   
Name: Murulimadhav
Date: 2010-09-23 10:18:30 PM
Comment:
Respected Sir,

I found a system IO file-system-based based My Picture Album (BrowseFS)by Scott Mitchell
( mitchell@4guysfromrolla.com Blog: http://ScottOnWriting.NET.)

And sir i needed a guidence from you. It is I am trying to select the treenode by select node method. But the node is not selecting even if i use the node vlaue map path. Please check this by testing page http://mytests.chaavadi.com. The script i used for select node method is given below. And sir, please guide me, even if i give the value map path too, why the nodes are not selecting by this method. I hope you will consider my request and guide me sir.

yours faithfully

murulimadhav

Script i used is:

Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs)

' Find the node specified by the user.
Dim node As TreeNode =
PictureTree.FindNode(Server.HtmlEncode(ValuePathText.Text))

If Not node Is Nothing Then

' Indicate that the node was found.
Message.Text = "The specified node (" & node.ValuePath &
") was found."
node.Select()
node.Selected = True
node.Expand()
DisplayPicturesInFolder(PictureTree.SelectedValue)

Else

' Indicate that the node is not in the TreeView control.
Message.Text = "The specified node (" & ValuePathText.Text
& ") is not in this TreeView control."

End If

End Sub
Title: Problem Solved   
Name: John Doe
Date: 2010-05-26 4:22:05 PM
Comment:
Fixed my problem. I just didn't use TreeNodeType and adapted the algorithm.
Title: Namespace Not Found   
Name: John Doe
Date: 2010-05-26 12:41:18 PM
Comment:
Am I missing a "using" statement somewhere? I do have "System.Web.UI.WebControls;" if that's it?

The error in question: "Error 1 The type or namespace name 'TreeNodeType' could not be found (are you missing a using directive or an assembly reference?)"
Title: Load Type   
Name: shark
Date: 2010-01-08 8:26:29 AM
Comment:
Try changing the namespace of the source code to match the namespace of your project.
Title: shark   
Name: k3
Date: 2010-01-08 1:05:27 AM
Comment:
Could not load type 'shark.TreeView.DocTree'.

What am I doing wrong ??
Title: Southampton dental implants   
Name: Southampton dental implants
Date: 2009-07-31 12:21:43 PM
Comment:
Thank you for the code.........
Title: Thank You Sooooooooooooooooooo Much   
Name: Prasanth Kumar
Date: 2009-02-05 2:52:04 AM
Comment:
Thank u so much for giving this code
Title: thanks   
Name: taintain
Date: 2008-08-19 12:24:41 AM
Comment:
Thank you very Much!
Title: Rightway Solution - Web Development Company   
Name: Neha Shah
Date: 2008-04-04 8:31:34 AM
Comment:
Hi,

Its really very interesting and Useful too.
Title: treeview control   
Name: deepak
Date: 2008-03-26 8:19:04 AM
Comment:
its useful and view is wonderful
Can I pass C# class objects to my web control. If yes please elaborate?

Thanks and regards
Title: treeview wincontrol   
Name: Anil
Date: 2008-02-05 1:04:42 AM
Comment:
I am using a wincontrol tree view (created as windows control library) in my web page. I would appreciate your help on the following,
- How do I want to ensure that only my latest wincontrol dll.
- Does the browser/IIS cache the dll. If yes how to prevent caching.
- I was able to do a drag and drop earlier but the same code is not working now. Any suggestions why this happens?
- Can I pass C# class objects to my web control. If yes please elaborate?

Thanks and regards
Title: Problem with TreeView Control   
Name: Santosh
Date: 2007-12-24 2:22:06 AM
Comment:
As I am using Treeview control whenever I click on the button beside node property it shows an error "Specified Cast is not valid" and I could not found TreeNodeEditor. Plz. solve my problem and also let me know how to bind my database records in a treeview.

Reply shaply plz : toskg@rediffmail.com
Title: Images are not Displaying   
Name: Rajasekhar
Date: 2007-12-06 7:31:22 AM
Comment:
Hello,
I cpied all the code into my system and but I could not able to see the folder images and also tree model can u help me out from this iisue
Title: TreeView Control   
Name: Vinith Phhilipose
Date: 2007-12-06 5:04:34 AM
Comment:
Its a very nice work.I got what i want.Thanks a lot.If you have any this kind of tips please sent to me.Thanks in Advance.

vinithphlipose@hotmail.com
Title: TreeView Control   
Name: Venkat
Date: 2007-11-05 12:26:09 AM
Comment:
Hi
i have one problem with this treeview. It is working fine locally but not working in live server. In live server it is showing images instead of +/- symbols because of this images i can't able to expand the treeview. Anyone could u plz help me.

Thanks in advance.
Title: TreeView Cntrl   
Name: marek
Date: 2007-09-03 8:53:54 AM
Comment:
Hi,
Do you know how to get the file name (in the code-behind) just after picking up the tree .

Thanks in advance.
Title: Tree View Cntrl   
Name: virendra marathe
Date: 2007-08-31 8:05:38 AM
Comment:
Whn I click on Aparment whole data will appear in Datagrid
using TreeView cntrl Can Anybody hve this code
plz send to virendramarathe@yahoo.com
Title: Mr   
Name: Mal
Date: 2007-07-04 3:12:23 AM
Comment:
How do I get this working on .Net 2005
Title: help me help me help me   
Name: mousa basiratnia
Date: 2007-05-10 12:03:43 PM
Comment:
hello
im an irania man that i wrote a programme like nero but a area of this programme faced problem . my problem is this that i cant write a function in vb.
this function is very very hard for me.
i wanna a function that write information in cd
and erase cd after writing
just this 2 function
for this reqest i will spend every mony that u want of me
iranian cant write this function
and i refer to you.
note : this function must writed in vb _ visual basic
thanks alot
my name is mousa basiratnia
my Id : 0123 3112284
-----------------------------------------------------------------
excuse me for this that i cant speak english very good
because im poor in english
----------------------------------

please help me
i have nobody without you
thanks alot
Title: Nested Iframes   
Name: Kaduuken
Date: 2007-05-08 6:36:04 AM
Comment:
First of all, very nice article.

I have no problems building a treeview in c#, feeding it with a database and then showing it on an asp.net page. I do have a problem getting the target property to work correctly. I'll try to explain.

Situation and problem:
I have a main page that consists of 1 iframe, ifrmMain(id). The source page of this iframe itself is split into 2 new iframes, ifrmMenu(id) and ifrmContent(id). The treeview is drawn in the source page of ifrmMenu. When I click a leaf in the treeview, I want the corresponding URL I designated in the navigateUrl property, to open in ifrmContent. Probably because my treeview is drawn in a source file that does not know the existence of ifrmContent, I cannot open the URL specified in navigateUrl in ifrmContent, although I have specified this in the target property of the node. Instead it opens the url in a new window.

Question:
Without redesigning the iframes setup, is it possible to open an url from the ifrmMenu in the ifrmContent iframe? And if so, how? Can I somehow goto the highest level of the window (ifrmMain) and then determine the target for the node?

Thx for any answers I might get.
Title: Help me :(   
Name: Nenita :(
Date: 2007-03-22 9:09:13 AM
Comment:
First, apologize for my bad english. :(
I was trying to execute this sample but not running :(
I want to know how can i view the files contains in a directory on my server. Like a FTP!
Plis help me! :(
(Spanish: Quisiera saber cómo hago para que desde mi aplicación se puedan mostrar todos los archivos contenidos en un directorio del servidor..)
I'm programming with C# and ASP.Net
Thanks a lot for who can help me with a sample!
respond here: aprendiz83@gmail.com
Title: Help   
Name: Serge
Date: 2007-01-05 2:39:32 PM
Comment:
Wow exacly what I need but
I can't get it to work , please help me. I keep getting errors
sergel@microgesta.com
Title: Nice One   
Name: NERD
Date: 2006-11-21 10:21:47 PM
Comment:
It's a nice example for tree view in ASP.Net supported both C# and VB.Net .
Title: Treeview control does not work on IE7   
Name: Raja
Date: 2006-11-15 8:15:48 PM
Comment:
The ie treeview web control works OK on IE6 - however on IE7 instead of rendering the tree, the nodes are just listed side by side.

Has anyone found a solution to this problem apart from moving to the native asp.net 2.0 navigation (we are still on .Net 1.1).

If anyone has found a solution please share on this forum. Thanks
Title: Mr   
Name: Nishant
Date: 2006-10-03 7:43:11 AM
Comment:
Excellent
Title: Small issue   
Name: Kiran
Date: 2006-08-17 3:58:41 AM
Comment:
Hi Steve,
The vb.net code is really wonderfull, but there is a small issue I found while building tree with having only one folder under the Directory which given in Mappath().
e.g.
GetFolders( MapPath( "~/./BaseFolder" ), TreeCtrl.Nodes );

Folder1
SubFolder1
File1
File2
SubFolder2
File1

Here Folder1 will come with junk image.How to solve this problem.?
I'll appriciate your reply.
Thanks,
Kiran
kiranjosh@dacafe.com
Title: u r rocking man   
Name: Debasis
Date: 2006-07-05 8:42:05 AM
Comment:
excellent!!!

itdebasis@yahoo.com
Title: beautiful   
Name: AnuElezabath
Date: 2006-06-22 2:15:59 AM
Comment:
its a beautiful site
Title: Urgent help   
Name: Ruchir
Date: 2006-06-14 3:08:22 AM
Comment:
Hi,

Where i can get webctrl_client directory.

Thanks and Rds
Ruchir
ruchir@oliveinternet.com
Title: i can't get treeview   
Name: Ruchir
Date: 2006-06-14 3:07:13 AM
Comment:
Where i can get webctrl_client directory.

Thanks and Rds
Ruchir
rucir@oliveinternet.com
Title: How to view word documents??   
Name: Smokingguns
Date: 2006-05-12 3:31:50 PM
Comment:
Hey steve,
This is indeed a very powerfull article. I would like to know how one views the word documents listed in this tree view bcoz I have to make a similar application..
Title: Thank you   
Name: Utkir
Date: 2006-05-07 4:02:16 AM
Comment:
Thank you very much!!!
I find anser to my question
Title: Great work, but listed .pdf & .jpg documents fails to open   
Name: Olaolu
Date: 2006-05-05 6:47:48 AM
Comment:
This is a great work, but what do i need to do to get all listed files especially .pdf and .jpg files to open in iframe? when i click on any listed pdf or jpg file, "The page cannot be displayed" error page is displayed in the frame.
Title: Very nice work   
Name: Mike
Date: 2006-04-23 2:15:39 PM
Comment:
It works for ASP.NET VB, just convert the code.
Title: while running i can't get treeview   
Name: senstar
Date: 2006-04-21 10:55:03 AM
Comment:
Hi
Good work, but I have one problem: when I'm running the example in the IE it just shows the folders
and the files (one after another, just text, like in Notepad), no TreeView
Any ideeas?" i also copy the webctrl_client directory to the applications directory. but the same problem continues.please give solution to this problem.
Title: About Tree View   
Name: Suresh Kumar
Date: 2006-02-02 1:40:23 AM
Comment:
I want to know how to maintain tree view state
Title: More?   
Name: JanaG
Date: 2006-02-01 3:08:30 PM
Comment:
This is a great article - one of the best I've seen. I'm trying to take the tree menu a step further. When a user clicks to expand or collapse nodes, then clicks a link, how do you save the current state of the menu and display on the next page? Any help would be greatly appreciated.
Title: Need Help   
Name: Niraj
Date: 2005-12-22 3:19:52 AM
Comment:
When i put treeview control on page and apply your above code and run the project that time tree view is not display but only records are display.
Title: Reg Triee View Control   
Name: Santhosh chary M
Date: 2005-12-10 6:08:50 AM
Comment:
hi,
This is santhosh. Iread ur material..that sounds great. I would like to receive more components that u know.
my email id is santhoshcharym@inbox.com
Title: Force Inherited Checks   
Name: Muhammad Numan Saeed
Date: 2005-12-01 1:45:40 AM
Comment:
Its very Good (Excellent).
Can we force inherited checks in IE Web control.
e.g Checking the Root node will check all its sub-nodes.
or unchecking the root node also uncheck the Sub Node.
(it should be in Client side event).

Thanks
email:merozoit@yahoo.com
Title: Mr.   
Name: Sai
Date: 2005-11-29 7:21:23 AM
Comment:
I need to populate tree control through database.
Title: web control   
Name: vivian
Date: 2005-11-16 1:33:16 AM
Comment:
It is very useful ,thanks a lot
Title: Web Control Tree View from MS   
Name: Frances
Date: 2005-11-15 9:33:16 AM
Comment:
http://msdn.microsoft.com/library/default.asp?url=/workshop/webcontrols/webcontrols_entry.asp
Title: how will get two way relation ship in treeview   
Name: robert
Date: 2005-10-26 8:18:23 PM
Comment:
it was good but sir can u tell me how can i get it in 2way relation as like windows explorer.
thanx
Title: Excellent   
Name: Khushru F Doctor
Date: 2005-10-24 8:56:43 AM
Comment:
This is excellent!

Regards,

Khushru Doctor
http://www.cygnet-infotech.com
Title: Treeview not work correctly   
Name: anjop
Date: 2005-10-13 9:22:03 AM
Comment:
I compiled my treeview in .NET Framework 1.1. But, in the server hosting (who has the version 2.0) it does not work. What does happen?
Title: Answer to your question   
Name: Chip Pumphrey
Date: 2005-08-30 10:42:23 AM
Comment:
Everybody seems to be asking the same question here.

To fix the problem where the browser just shows you the text of the folders and not the actual tree view, you need to move the WebCtrl_Client folder to the ROOT DIRECTORY of your application.
Title: Problem   
Name: Tree View
Date: 2005-08-29 12:48:19 AM
Comment:
I have a Application using the Tree web control. In Develomenet Enviour ment it is working fine.

We have deploye the Application on 2 Diffrent Sever. Both has Win 2003 as OS.

On Server it is working fine. Other is showing the Folder and file and text strings. Not Tree like formate. Can you halp me out.

Contact me on vinod.birla@v2solutions.com
Title: Clear My doubt   
Name: Sarmak.M.C
Date: 2005-07-28 3:31:25 AM
Comment:
Hai i read u r article..it is good..
Can u help me to add nodes to tree from database...that up to 'n' level i want to add..if u have the code pls send to my email id mcsarmakmca@yahoo.co.in
Title: Nice one   
Name: Shawpnendu Bikash (Partha)
Date: 2005-06-21 12:59:03 AM
Comment:
Thank You for your great article.
Title: Smart Job   
Name: Himadrish
Date: 2005-06-20 10:05:41 AM
Comment:
I searched the net for use full function to populate tree node in my C# windows application...I found this one...

It is preety nice and functional way had done...Great Job.

My best wish to Steve.

Cheers,
~Himadrish
(himadrish@yahoo.com)
Title: Comment   
Name: Five
Date: 2005-06-15 4:53:59 AM
Comment:
This is great article. It make me more understand about tree view web control. Thanks!
Title: more useful - tree view   
Name: Ramesh babu
Date: 2005-05-10 4:33:15 AM
Comment:
hi

i got a complet solution regarding tree view. i had refered so many site but this will give me a complete solution. keep it up
Title: problem   
Name: Zoltan
Date: 2005-04-14 4:16:54 AM
Comment:
"Hi there
Good work, but I have one problem: when I'm running the example in the IE it just shows the folders
and the files (one after another, just text, like in Notepad), no TreeView
Any ideeas?"

Find the webctrl_client directory and copy it to the applications directory.
Title: why DirectoryBrowser problem with windows server 2003   
Name: sexboyyi
Date: 2005-04-11 5:42:14 AM
Comment:
Anybody can answer this?
Title: XML   
Name: Ravi
Date: 2005-04-07 9:31:09 AM
Comment:
Hi,

Article is excellent. I would like to know how we can bind(link) DataSet/XML file to treeview.

Regards
Ravi
Title: Highlight Folder   
Name: Lon
Date: 2005-04-02 11:33:28 PM
Comment:
It would be nice to be able to highlight (Red, Yellow, Green) the folder by adding a file. This would indicate that there was something that needed to be looked at in the folder.

Thanks,
Lon
Title: Javascript in Treeview control   
Name: Karthick
Date: 2005-03-31 5:09:07 AM
Comment:
It will be nice to know how to open a popup window when a node in the treeview control is clicked. I want to give them choices (menu) to do some data manipulation such as Add, Deletion in the new window. Does anybody know where I can find some useful links to achieve this ?. Thanks.
Title: Works fine Except for Images   
Name: surya
Date: 2005-03-22 7:06:46 AM
Comment:
Hi, great article, works fine except that it does not show any of the images for expanding and contracting. i have not made any change from the code you have give.
regards
surya
(phani@xinthe.com)
Title: The data at the root level is invalid. Line 1, position 1.   
Name: Karthik
Date: 2005-03-22 5:47:05 AM
Comment:
I'm getting Error shown below :

If i use TreeNodeSrc="aspnetbooksTV.xml" then i'll get the followign error . How to over come this ?
The data at the root level is invalid. Line 1, position 1.
Title: too good   
Name: rohit patel
Date: 2005-03-22 1:46:34 AM
Comment:
this is very nice one . and helped me out
Title: New Download URL   
Name: Steve
Date: 2005-03-16 11:48:25 AM
Comment:
There are some new download URLs for the TreeView. One of them is: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnet-usingtreeviewiewebcontrol.asp
Title: 非常感谢!   
Name: 张孝天
Date: 2005-03-16 6:15:47 AM
Comment:
thinks for a lot!
Title: namespace question   
Name: fish
Date: 2005-03-02 7:44:34 PM
Comment:
Does anyone know how to import the namespace into a .cs file? When I try to construct new treenodes (e.g. TreeNode thisTree = new TreeNode("blah")), I get an error that the type or name TreeNode could not be found.

Any ideas?
Title: Excelent   
Name: Kaushal G. Visani
Date: 2005-02-17 4:58:23 AM
Comment:
That is nice,
thanks for yr that kind help
it is very useful me.
i also inspire to send my open source to u
if i create anything new i send it to u
Title: Great Work   
Name: N.R
Date: 2005-02-16 4:50:56 AM
Comment:
hey steve,

Thanxs man. you saved me lot of effort.

Keep it going
Title: Default View   
Name: Kevin
Date: 2005-02-14 3:49:47 PM
Comment:
Does anyone know how to force the default view in the i-frame. I would like to force detail view. I see that a subroutine can be set up for a listview, but that seems like a lot of work. I can change the view by right clicking, so I am thinking there should be a simple attribute I can force for the view. If anyone knows, I would appreciate it.
On the no tree structure issue, it was a simple config issue. The webctrl_client folder needed to be in the root directory of the web server. I read a customized install document that failed to mention that fact. I hope that info solves the problem for someone else.
If anyone has an answer to the first question my e-mail is k.l.holland@comcast.net. I've also got some code that compliments this treeview I can share. Examples on adding manual nodes along with dynamic ones and a recursive removal of nodes if you want to remove specific folder views. I have archive folders throughout my server I have chosen to hide. It seemed the easiest way was to remove them rather than trying to skip them.
Title: Not in a tree structure   
Name: Kevin
Date: 2005-02-09 10:03:54 PM
Comment:
I seem to be having the same problem everyone else is. I get a listing of directories and files in order with no icons, no + -, and no tree structure. I have the same problem when I create a treeview program from scratch. That is why I was looking for a working example. I'm thinking it must be simple, but the answer escapes me.
Title: Nice Artical   
Name: srinivasa prasad
Date: 2005-01-24 6:26:18 AM
Comment:
HI! Its very nice to see this type of articles.
You've done a splendid job
Title: TreeView   
Name: Sunny
Date: 2005-01-24 1:58:57 AM
Comment:
Thanks for this article.
But If i Bind Treeview with XML, I am facing some problems like " The data at the root level is invalid. Line 1, position 1."
But its working in Local Server. But on the hosting server its giving the above problem. Can U help me out in this issue.

Thanx
Mailid : kaja_suni@yahoo.com
Title: problem   
Name: Nick
Date: 2005-01-19 9:00:41 AM
Comment:
Hi there
Good work, but I have one problem: when I'm running the example in the IE it just shows the folders and the files (one after another, just text, like in Notepad), no TreeView
Any ideeas?
Thanks!
email: pnq77@yahoo.com
Title: How does it work with C#   
Name: Siddharth Sathe
Date: 2005-01-18 2:00:28 AM
Comment:
\
Title: How does it work with C#   
Name: Siddharth Sathe
Date: 2005-01-18 1:40:26 AM
Comment:
I am using the code given for C# but it gices error for line

private TreeNode Node( string path, string text, string type )

saying it doesnot recognize TreeNode

also same thing hapens for TreeNodeCollection

what should i do sathesiddharth@gmail.com
Title: Transparent Background   
Name: Nithya
Date: 2005-01-18 12:33:32 AM
Comment:
Hi! excellent article!
Is it possible to apply a transparent background to the control? In order to be able to see a .gif
that I have in form?
Mail Me Ur Replies to
nithya.renuga@icici-infotech.com
THANKS IN ADVANCE...

Best Regards,
Nithya.
Title: Have a question   
Name: G.Y Yu
Date: 2004-12-13 1:34:44 AM
Comment:
hi
Please tell me how to get the text of Selected node.
thanks
12/13/2004
Title: Transparent Backgruon   
Name: Sergio Cossa
Date: 2004-11-24 7:59:27 AM
Comment:
Hi! excellent article!
It is possible to apply a transparent background to the control? In order to be able to see a .gif that I have in form?

Thanks in advance

chechocossa@hotmail.com
Title: MANY THANKS!   
Name: Tonos
Date: 2004-11-17 11:56:27 AM
Comment:
This article was REALLY VERY HELPFUL also for me Steve!
Many thanks for publishing it!
Title: Very usefull   
Name: Chathura
Date: 2004-11-10 12:30:06 AM
Comment:
This artical was very helpful for me.

Thanks Steve...

Regards,

chathura_sl@yahoo.com
Title: all I want to say   
Name: Ronnie
Date: 2004-11-05 7:13:32 PM
Comment:
IS PERFECT !!!

email: rli@adaptrust.com
Title: Convert to VB from C#   
Name: Steve Sharrock
Date: 2004-10-19 12:37:48 PM
Comment:
This is one of the sites you can reference to convert C# to VB.

http://www.kamalpatel.net/ConvertCSharp2VB.aspx
Title: VB.NET   
Name: Armando
Date: 2004-10-19 12:13:04 PM
Comment:
Have you this example in VB.NET ? HELP ME !
Title: trouble   
Name: huertta
Date: 2004-09-27 2:12:01 PM
Comment:
Please, can anybody help me. I am trying to use treeview but it just shows the folder and file list but it is not really showing the tree.
Any clues?
Thanks!
Title: Problem with treeview   
Name: Edmond
Date: 2004-09-03 4:12:29 AM
Comment:
in server IIS preview is no problem..but in client side pc..only can see words..no tree
Title: Problem with Treview   
Name: Ronald Morales
Date: 2004-09-02 8:39:29 AM
Comment:
Hi,
I follow your example to implement the treeview with a SQL relational Database with 6 levels. The treeview works fine, but I dont know how make that all item in the treeview can execute the option NavigateUrl. Only items with inferior level can execute.

Thanks
Ronald Morales
Title: Great Article   
Name: graham
Date: 2004-08-26 9:02:51 PM
Comment:
I have been trying to implement the treenodetypes for a while. Your article explained it perfectly and it worked first time. Many thanks.
Title: Download   
Name: selcuk
Date: 2004-08-25 8:27:20 AM
Comment:
You Can Download
http://download.microsoft.com/download/2/9/0/290e3bc2-a238-447f-ad45-98e590b3048b/TreeViewControl.msi
Title: Help Me!   
Name: wuchen
Date: 2004-08-19 4:41:34 AM
Comment:
I have to put some radio input,input,chexkbox controls in treeview control ,what shall i do ? My Email is scwuchen@hotmail.com
Title: This Was Great!!!!   
Name: lhbail
Date: 2004-08-18 3:37:29 PM
Comment:
THANKS SO MUCH FOR SHARING THIS CODE!!! I've been trying to find a way to create this directory TreeView for a little while and kept have all these minor issues with some parts not working quite right.

This is the first one that actually works!!

Thanks so much Dana for the VB.NET translation, it was just what I was looking for!
Title: Will not open in target iframe   
Name: HJP
Date: 2004-08-17 11:05:44 AM
Comment:
I'm having problems getting the navigateurl to open in the target iframe. Any Clues?
Title: treeview   
Name: aa
Date: 2004-08-16 2:25:40 AM
Comment:
This is good .but how to select next node programatically?,in situations like when one user deletes the node then next node should be selected.
Title: to Anat: download Microsoft WebControls' ur   
Name: Ehbc
Date: 2004-08-15 11:36:00 PM
Comment:
ur=
http://asp.net/IEWebControls/Download.aspx?tabindex=0&tabid=1
You can try again? But I can't right.
Thanks.
Title: where can I download Microsoft WebControls ?   
Name: Anat
Date: 2004-08-09 2:33:07 AM
Comment:
Hello

Where can i download MicrosoftWebControls. the URL you gave is not valid any more.

best regards
Anat
Email: anato@kc-sys.com
Title: You Rock   
Name: Jim Finlon
Date: 2004-07-30 1:59:19 PM
Comment:
Thanks for the great article, you saved me several hours of coding and research. Much appreciated
Title: Very Useful   
Name: MK
Date: 2004-07-29 7:50:45 PM
Comment:
Great Piece of work Steve.
Many Thanks 4 publishing it.
Title: Good one   
Name: Mehul
Date: 2004-07-20 7:14:18 AM
Comment:
This is nice. Thanks for ur efforts, it will really help.

From:
Mehul
email: mehul@tatvasoft.com
Title: helpd   
Name: dan
Date: 2004-07-13 5:18:49 AM
Comment:
thank it helpd a lot your articel
i didnt know how to us the tree view on web pages
but it looks preety clear now
thanks
Title: have a surprise   
Name: share
Date: 2004-07-05 1:47:20 AM
Comment:
thanks for your kindness






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2017 ASPAlliance.com  |  Page Processed at 2017-10-22 6:53:51 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search