Hi there,
You have a few options. One is to stick with the XSL file. I am not too good with XSL to I can't recommend much to improve your code.
Alternatively, you can use the SiteMap file and provider. This control displays hierarchical data by default. You could write a physical copy of the site map whenever you make a change in the categories in the system.
Finally, you can indeed use a relational dataset with a self referencing column. You could write a recursive method that loops through this dataset and manually adds nodes to the TreeView at the requested level. I have done that a while ago, so I can assist you with it if you need some help.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of
ASP.NET 2.0 Instant Results and
Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.