1

Edit: Duplicate

I'm new to .NET, and I've taken on a small work project, converting an existing VB6 product to a current version of VB (its either that or learning VB6!). This product is an internal desktop application (not web-based).

I need to create a new tree view, that is linked to a particular table.

Each row in the table has a parent id that links back to the table's primary key, and that defines the node hierarchy. So that relationship needs to be indicated in the databinding.

Am I able to use the standard treeview control in Visual Studio 2008, or do I need something extra to make this work?

Community
  • 1
  • 1
brasskazoo
  • 76,030
  • 23
  • 64
  • 76

2 Answers2

1

You can bind a tree view control using an XML file which will define your nodes or you can bind it by querying a database. Here is an article from 15 Seconds which has a pretty thorough tutorial on using the .NET TreeView control.

TheTXI
  • 37,429
  • 10
  • 86
  • 110
0

According to another question, this isn't possible, as the normal treeview control doesn't support databinding.

You'd need to either programatically populate, or use a third-party component (I've used Developer Express in the past with C++/Delphi components, they are fantastic!).

Community
  • 1
  • 1
brasskazoo
  • 76,030
  • 23
  • 64
  • 76