.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Auto expand / collapse treeview

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :ASP.Net


I created a sitemap with a treeview navigation in my aspx site.  I  am hoping someone can show me the code to put in a Masterpage so that when I expand a child node, all other nodes collapse, and when I expand another node, the previous expanded node collapses. I have an example here of what I am trying to accomplish:


I am using asp.net with VB.

I will appreciate any assistance with this.  I have been scouring the internet looking for a solution, but so far haven't found anything that works.

Thank you


View Complete Post

More Related Resource Links

WPF TreeView save expand-collapse state


Hi, I am using TreeView to display my data in UI. Now my application refreshes every 5 seconds so that it shows the most current data. Is there a way I can save my expanded state or collapsed state of treeview even after window reload? Because if I have a huge amount of data and I take more than 5 seconds to go to desired data, the TreeView just collapses after every 5 seconds with window refresh, and I have to start from scratch.

Treeview Expand or collapse only one Parent?


Hai all,

           please suggest me,how's it possible to expand or collapse only one parent node at time. 
i am using Xmldatasource. please help me. 

TreeView Navigation to have expand and collapse


Hi All,

I need the TreeView Navigation in SharePoint 2010 to behave like ASP.NET Treeview and also get the data from the Qucik launch. Is there any solution for this. Can anyone pls help me on this. Thank you.

May i use the collapse and expand feature (like tree menu) in Report ?


HI all,

May i use the collapse and expand feature (like tree menu) at Report iam using the Report viewer  Control for displaying the Report on my Asp.net Page .


I have number records and each record have detail as i clicked or expand the record then details will be shown is it possible with report viewer control 
If any one have experince before please share the ideas.


Best Regards

How to Prevent the expand/collapse behaviour of my Custom Activity?

  How can I prevent the expand feature of my custom activity with custom designer ? I have custom WF4 activities with Custom designers. These activities are not container activities. I just want to prevent the expand feature of the same; just like Assign activity. I set the Collapsible attribute of teh ActivityDesigner false; but still it is expanding to the next level. Thanks AmbilyIT Analyst

Expand /Collapse quick launch

Hi All, Can any one help in getting the below link script for collapse and expand quick launch. I did not find any script. it says to paste script in master page using designer http://www.endusersharepoint.com/2009/03/27/deploy-custom-jquery-scripts-to-the-sharepoint-site-collection/ any idea? i want exact above link Thanks in Advance

Navigation headings and links display in Treeview expandable collapse buttons in quick launch in Sha

Whenever i am adding Headings and Links in my sharepoint site under "Navigation", it should display in Treeview collapse expandable buttons in quick launch. How to achieve this, any suggestions please. I tried by enabling Treeview in Site settings-->Tree view, but it is not useful here(it only displays document libraries with folders in "+" or "-" symbols. I want this "+" and "-" for all items which  i am adding from Navigation.  Thanks & Regards, Neerubee

WPF Ribbon - Auto Collapse when Height is Less than 250

Hi, Can any one help me please with the new WPF Ribbon, I noticed that when you give the window that contains the ribbon control height less than 250 the ribbon auto collapse. after it auto collapses if you explicitly set it's visibility to Visible only the title bar is shown without the tabs. Any means to stop this behavior?

Expand/collapse row to create a new row to display a frame in a datagrid

Hi , I am using .Net Framework 2.0 as its a old application with a datagrid in a page. I want to expand each row when clicked to create a new row to display a page in the newly created row. Can someone help me in this regard<asp:datagrid id="dgdOrders" runat="server" cellpadding="4" borderwidth="1" gridlines="Horizontal" allowpaging="True" autogeneratecolumns="false" datakeyfield="OrderNumber" cssclass="gridStyle" pagerstyle-visible="False"> <itemstyle wrap="False" cssclass="gridItemStyle" backcolor="white"></itemstyle> <alternatingitemstyle wrap="False" cssclass="gridAltItemStyle" backcolor="WhiteSmoke"></alternatingitemstyle> <headerstyle cssclass="gridHeader"></headerstyle> <columns> <asp:templatecolumn headertext="Hold"> <headerstyle horizontalalign="center"></headerstyle> <itemstyle horizontalalign="center"></itemstyle> <itemtemplate> <%# DataBinder.Eval(Container.DataItem, "IsHold") %> </itemtemplate> </asp:templatecolumn> <asp:templatecolumn headertext="Purchase Order"> <headerstyle horizontalalign="center"></headerstyle>

Disable Expand All/Collapse All workflow designer hyperlinks?

Hi,In a blog post by Matt Winker (http://blogs.msdn.com/mwinkle/archive/2009/10/20/wf4-designer-enhancements-in-vs-2010-beta-2.aspx), he notes that: "Additionally, you can choose to expand or collapse individual nodes, or go to the "Expand All" command in order to expand out the tree.  One thing to note is that we don't allow expansion inside of a flowchart because we don't yet have a mechanism that lets me rearrange all of the items around that newly expanded activity.  "My question is, will there be a way by the time RTM releases to do expansion within a flow chart?  The flow chart model is what I'll be using exclusively, so I'm quite interesetd in this.If there will not be support by the time workflow reaches RTM, is there or will there be a way that we can hide the Expand All/Collapse All hyperlinks?Thank you,Notre

How can I show Plus sign(Expand mode) Before treeview item in wpf?

Hi,    We are using tree view control in XBAP,in which I m listing all parent node. But it doesnt show plus sign(For expansion) before node header. We have written code to fetch node's child on ItemChanged event.When I click on node and if its have children its showing plus sign.  Do any body know how to show plus sign regardless of whether that node has child or not? Regards, Mehul

Create a Tree view with expand or collapse using XSLT


I have created an XSLT file to show the contents of xml in HTML format in the form of a tree. Now, my requirement is to add expand or collapse capability to this output(html) using XSLT and Javascript. The sample output looks like this:

Resource Center

programmatically expand/collapse the collapsiblepanelextender


using c#.net/asp.net 2005.

I have a collapsiblepanelextender that is working well when the user clicks on the "expand" and "collapse" buttons on the screen, however I would like to programmatically expand and collapse the collapsiblepanelextender in the c# code-behind.  Has anyone done this before?

I am typing the name of the collapsiblepanelextender in the code behind function and intellisense is not even showing that control as being a control that I can access from the aspx page so not certain why this is happening.

when I look in the aspx page the collapsiblepanelextender has a red squiqqly error line under it that says (when you mouse over it): "element 'collapsiblepanelextender' is not a known element. this can occur if there is a compilation error in the website"

but the panel works well when the user clicks it to expand and collapse and there are no compilation errors on the page, otherwise the page would not run, does this make sense?



Expand /Collapse quick launch


Hi All,

Can any one help in getting the below link script for collapse and expand quick launch.

I did not find any script. it says to paste script in master page using designer


any idea?

i want exact above link

Thanks in Advance

SSRS 2008 - Drilldown - Grouping collapse/expand /title/header



I have been able to have a report with Group / Group count and Details.

The issue I have are:

1. When I collapse the drilldown to get only the Group and Group countit just collapse per page not the full report...I would like to have all Group / Group count on 1 or two pages and then epand as needed...

2. The title and column headers appear only on the first page... how to get it on all pages?

What is the "Linked Report" doing? Is it another kind of Drill Down..?

I need to have my summary report per OS for example shows only the OS Name then Count and if I click to expand I will have the servers in this group... but it seems working reverse way, I mean you have the details and if you collaspe you have the summary but this seems limited per page...



System Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 Support

Expand All/Collapse All Buggy


I've scoured the forums and no one has ever answered this question for other people who have posted it.

I have a SSRS 2005 report where the user can choose to expand all groups by selecting yes or no in a parameter called ExpandAllGroups. It works great for the most part - if they chose to expand all groups, then all four groups and my details line all show as expected.

However, once they've run the report with everything initially expanded and they decide to collapse group #1 it will actually still retain all the space that the three child groups occupied. So if it took up five pages total and you collapse it, it still has five pages of white space showing between what you just collapsed and the next grouping. My report is massive and I have one group that if you collapse it then you have something like 50 pages of white space until the next group.

The only suggestion I've seen is setting up your visibilty property via the group dialog box rather than the visibility properties for the row. I did this to no avail. It doesn't appear to matter if I do it on the row or on the group, it still fails to collapse correctly.

Anyone found a solution to this?? There were about a half dozen previous posts with the same issue but no resolution was ever posted.




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend