troubleshooting Question

Setting Custom Images (ImageSet) for TreeView Control

Avatar of wmhogg
wmhogg asked on
ASP.NETMicrosoft SharePoint
1 Comment1 Solution4700 ViewsLast Modified:

I am creating an ASP.NET 2.0 web part that will be used in SharePoint in the Page Load event.  I currently have the TreeView working with the following code:

            TreeView1 = new TreeView();
            TreeView1.ShowLines = true;
            TreeView1.ShowExpandCollapse = true;
            TreeView1.ImageSet = TreeViewImageSet.XPFileExplorer;

However, I would like to use custom images (i.e. SharePoint icons) for the Parent and Child nodes.   Keeping in mind that I don't have an ASPX page or access to a Properties Window in the web part, could you please provide me with some sample C# code as to how to set the Parent and Child Nodes' icons?



Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros