Solved

Playing with TreeViews

Posted on 2007-04-05
3
298 Views
Last Modified: 2012-08-13
Is there a way to use a TreeView to do a nifty collapsable page, like so:

<asp:TreeView ID="treeMainMenu" runat="Server" ExpandDepth="0" NodeIndent="5">
    <LeafNodeStyle CssClass="lnkBlueBold clsNinetyPercentFont clsUnderline" ChildNodesPadding="1" />
    <ParentNodeStyle CssClass="lnkRedBold clsNinetyFivePercentFont" />
    <SelectedNodeStyle CssClass="lnkBlueBold clsNinetyPercentFont" />
    <RootNodeStyle CssClass="lnkBlackBold" />
    <Nodes>
        <asp:TreeNode Text="Process" SelectAction="Expand">
            <asp:TreeNode Value="T01">
                <div>buncha content here</div>
                <div>buncha content here</div>
                <div>buncha content here</div>
            </asp:TreeNode>
            <asp:TreeNode Value="T02">
                <div>buncha content here</div>
                <div>buncha content here</div>
                <div>buncha content here</div>
            </asp:TreeNode>
        </asp:TreeNode>
    </Nodes>
</asp:TreeView>
0
Comment
Question by:Paul Kahl
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
craskin earned 500 total points
ID: 18861654
want you want is an accordion, not a treeview.
0
 
LVL 12

Assisted Solution

by:craskin
craskin earned 500 total points
ID: 18861665
as far as i know, the asp:treeview control would not work the way you're asking. if you don't want to get into javascript or ajax, you can still do a postback accordion using asp:panel controls and views. it's just harder that way. the MS ajax CTP from www.asp.net/ajax has an accordion control that does what you want.
0
 
LVL 3

Author Comment

by:Paul Kahl
ID: 18861677
So a set of nested asp:Panel sets controlled in code-behind, basically, doing postbacks. Or some javascript and CSS, and a nice chunk of Divs.

Is there any nice documentation on accordion methodology out there?
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now