We help IT Professionals succeed at work.

Multi-Level Treeview

cadwal01
cadwal01 asked
on
I have a table that has ten columns that represent a hierarchal structure that I want to visually represent in a treeview.  Looking for the best way to load the structure.  The columns would be like

Lev1
Lev2
Lev3

Thanks,
Comment
Watch Question

Top Expert 2010
Commented:

Commented:
Is it a recursive table? In that case I prefer to use a "FOR XML" query to get the data in XML and an XSL file with a recursive template to build the tree.
Top Expert 2010

Commented:
This is how you can populate TreeView using XML:

http://support.microsoft.com/kb/317597

Commented:
So, for the TreeView control you need the XML to already be hierarchical structured. You don't get that easily from a recursive table in a database.

But the matter here is if the table is recursive. From the description in the question it does not look that way, because of the "ten columns" remark. Please, show the table design.