Solved

Playing with TreeViews

Posted on 2007-04-05
3
300 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

16 Experts available now in Live!

Get 1:1 Help Now