• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 979
  • Last Modified:

VB.net bind a dataset to a TreeView

Hi

What VB.net code would I use to bind a dataset to a TreeView
0
Murray Brown
Asked:
Murray Brown
3 Solutions
 
Luis PérezSoftware Architect in .NetCommented:
Check this code snippet from Microsoft:
http://support.microsoft.com/kb/320755/en-us

Hope that helps.
0
 
Éric MoreauSenior .Net ConsultantCommented:
The treeview cannot be bound. It is a too complex structure. You need to feed it manually. Check http://emoreau.com/Entries/Articles/2006/04/The-Treeview-control.aspx
0
 
YZlatCommented:
you can loop through the dataset and add items to the treeview
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
YZlatCommented:
try something like that:

  Dim tn as TreeNode
For Each row As DataRow In ts.Tables(0).Rows
        tn = New TreeNode(row.Item(0))
	tn.Text=row.Item(1)
        TreeView1.Nodes.Add(tn)
Next 

Open in new window

0
 
YZlatCommented:
or you can use RadTreeView and bind it to your dataset

http://www.telerik.com/help/aspnet-ajax/treeview-data-binding-database.html
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much for the help
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now