How to make a treeview transparent

Hi - I have made a simple web part (server control) for sharepoint that has a tree view on it.  I have set the web parts background image to an image and want to see the image through the tree view.  It happened once but then stopped working.  
I have tried setting the backcolor to color.transparent but this doesn't work.
I am using an associated css style sheet and a javascript js file as well if that helps.
millerthegorillaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dustin HopkinsSenior Web DeveloperCommented:
Which part of the treeview are you wanting to show transparent?
you could use this css and apply it to which ever nodes you want to be transparent, not sure about applying it to the images though.
<style  type="text/css">
    .trans{
    filter: alpha(opacity=50);
    -moz-opacity: 0.5;
    }
    </style>

then just apply this class like below
<RootNodeStyle  cssclass="trans" />
            <ParentNodeStyle Font-Bold="False" cssclass="trans"  />
            <HoverNodeStyle Font-Underline="True" ForeColor="Purple" cssclass="trans" />

Open in new window

0
millerthegorillaAuthor Commented:
Hi - I am trying to use a c# treeview and make its background transparent.  Thanks for your help though.
What is the xml for in the code that you submitted?  Is it xsl?
0
Dustin HopkinsSenior Web DeveloperCommented:
No, those are the node style attributes in the treeview.
Theoretically if you apply the css class to the treeview then it should make it trasparent, however for the life of me i can't get it to work in the browser...i'll work on it a little more and post back if i find a solution.
0
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

Dustin HopkinsSenior Web DeveloperCommented:
ok this seemed to work, i tested it in ie7 and firefox.
here is the style class:
 <style type="text/css">
    .trans{
     filter:alpha(opacity=80);/*Semi-Transparency for IE*/
     -moz-opacity:0.8;/*Semi-Transparency for Mozilla*/
     opacity:0.8;/*Semi-Transparency for Gecko*/
}
    </style>

then just apply it to your treeview
<asp:TreeView ID="TreeView1" runat="server" CssClass="trans" BackColor="#333300" 
            ImageSet="Simple" ShowLines="True" Width="300px"></asp:TreeView>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
millerthegorillaAuthor Commented:
Hi - I turned on my pc this morning and went to the site with the treeview and it was working fine?!  I didn't change anything and the background was showing through.  The only thing that I can think is that it is a bug in the tree view control. I'm loathe to touch it for fear of breaking it.  I'd like to implement your suggestion though so I'll create a new version.  I'll be back when I've tried it.  
0
millerthegorillaAuthor Commented:
Hi - I tried it but it doesn't work.  It seems that IE (which I've got to use) isn't accepting the filter style.  I am using sharepoint designer to edit the css and when I enter 'filter' or any other opacity command sharepoint designer underlines it in red and complains that the 'property is invalid because its not supported by the current schema'.  I didn't know stylesheets had schemas.  I presume its referring to the schema on the sharepoint master page.
Thanks for your help anyway.  Have some points :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.