Avatar of wmhogg
wmhogg
 asked on

Setting Custom Images (ImageSet) for TreeView Control

Hi,

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;
           
            Controls.Add(TreeView1);

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?

Thanks,

William
ASP.NETMicrosoft SharePoint

Avatar of undefined
Last Comment
TheMegaLoser

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
TheMegaLoser

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23