Solved bind a dataset to a TreeView

Posted on 2012-09-21
Last Modified: 2012-09-21

What code would I use to bind a dataset to a TreeView
Question by:murbro
    LVL 25

    Assisted Solution

    by:Luis Pérez
    Check this code snippet from Microsoft:

    Hope that helps.
    LVL 69

    Assisted Solution

    by:Éric Moreau
    The treeview cannot be bound. It is a too complex structure. You need to feed it manually. Check
    LVL 35

    Expert Comment

    you can loop through the dataset and add items to the treeview
    LVL 35

    Expert Comment

    try something like that:

      Dim tn as TreeNode
    For Each row As DataRow In ts.Tables(0).Rows
            tn = New TreeNode(row.Item(0))

    Open in new window

    LVL 35

    Accepted Solution

    or you can use RadTreeView and bind it to your dataset

    Author Closing Comment

    Thanks very much for the help

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    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

    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    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…
    This video discusses moving either the default database or any database to a new volume.

    760 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

    9 Experts available now in Live!

    Get 1:1 Help Now