VB.net bind a dataset to a TreeView

Hi

What VB.net code would I use to bind a dataset to a TreeView
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
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
 
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
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
YZlatCommented:
you can loop through the dataset and add items to the treeview
0
 
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
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much for the help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.