Treeview (Web)

Posted on 2012-09-17
Last Modified: 2012-10-02

I’m doing some development work on a tree view (web) control.  So far I have managed to build the tree view correctly.

The next stage is that I need to loop through the nodes and where appropriate add some more nodes in.  This will involving changing the position of some of the existing nodes.  Doing this is proving to be very hard.

I have managed to loop through all the nodes and export the value path string into a list box control.  Is it possible to create the tree view by using this data – the rational being that it’s easier to alter the data when it’s not in the tree view structure?

Another possible way would be to export in XML, alter, then recreate from the XML

Any suggestions appreciated.
Question by:andyw27
    1 Comment
    LVL 96

    Accepted Solution

    The TreeView supports connecting to a data source that provides hierarchical data.  You could provide XML content to an XmlDataSource, and bind the data source to the TreeView.  If you need to change nodes, add them to the XML content, and re-bind the TreeView.

    Walkthrough: Displaying Hierarchical Data in a TreeView Control

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now