Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Asp.net 2.0 Treeview Control-How to use expand collapse without images

Posted on 2008-10-01
4
Medium Priority
?
1,671 Views
Last Modified: 2013-11-19
I have a treeview control with one root, 2 parents and several nodes.  The expand collapse is working fine for the menu structure but can I use the control without the +- image or use an empty image?? The html code is below.   Any help would be appreciated, thank-you very much.
<asp:TreeView ID="TreeView2" runat="server" DataSourceID="XmlDataSource3" style="font-size: 10pt; font-family: Arial; position: absolute; left: 455px; top: 118px; width: 280px" NodeIndent="0" Height="81px" Width="197px" EnableViewState="False" MaxDataBindDepth="2" ExpandDepth="2" >
            <DataBindings>
                <asp:TreeNodeBinding DataMember="UWDocs" TextField="text" SelectAction="None"/>
                <asp:TreeNodeBinding DataMember="CertificateOfFacReHeading" TextField="text" ValueField="text" selectAction="Expand"/>
                <asp:TreeNodeBinding DataMember="CertificateofFacReDocList" NavigateUrlField="url"
                    TextField="text" ValueField="text" ImageUrlField="#Value" />
                <asp:TreeNodeBinding DataMember="LapsedCancelledBusMemoHeading" TextField="text"
                    ValueField="text"  SelectAction="Expand"/>
                <asp:TreeNodeBinding DataMember="LapsedCancelledBusinessMemoDocList" NavigateUrlField="url"
                    TextField="text" ValueField="text" />
 </DataBindings>
            <ParentNodeStyle Font-Names="Arial" Font-Size="10pt" Width="280px" />
            <SelectedNodeStyle Font-Names="Arial" Font-Size="10pt" />
            <RootNodeStyle Font-Names="Arial" Font-Size="10pt" ForeColor="Black" cssClass="GeneralRoot"  BackColor="Transparent" Width="300px"/>
            <NodeStyle Font-Names="Arial" Font-Size="10pt"  VerticalPadding="2px" Width="280px" HorizontalPadding="1px" ForeColor="SlateBlue" CssClass="mynode"/>
            <LeafNodeStyle Font-Names="Arial" Font-Size="10pt" /> 
            <HoverNodeStyle BackColor="#EAEAF5"  />
        </asp:TreeView>
        <asp:XmlDataSource ID="XmlDataSource3" runat="server" DataFile="~/Canadian/CanadianXMLTesting/CanadianHomePageUWDocumentsMLFile.xml">
        </asp:XmlDataSource>
       </div>

Open in new window

0
Comment
Question by:lnshop
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 750 total points
ID: 22620792
For TreeNodes without images, specify the NOIMAGE value for both the ImageIndex and SelectedImageIndex properties. Don't set their ImageKey, SelectedImageKey properties. For the normal nodes, you are free to use indices or keys.

See this link for other caveats in this module --

http://www.codeproject.com/KB/tree/UsingTreenodes.aspx
0
 

Author Comment

by:lnshop
ID: 22635095
Does you solution apply to windows.forms or web forms?  For webforms, I think only way to do this is to either find another image or script the functionality of the treeview.  I will keep looking for an resolution and thank you very much for your help with this.
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 22635600
good question -- I think that applies to the web forms more than the windows forms, want me to check further?
0
 

Author Comment

by:lnshop
ID: 22635839
No, but thank you.  I think I will try to find another image.  The xml and treeview navigation works so well without a single line of coding, I want to use it and workaround the image problem.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question