This is a migrated thread and some comments may be shown as answers.

Expand/Collapse all nodes in Q3

5 Answers 131 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Eric Santos
Top achievements
Rank 2
Eric Santos asked on 01 Dec 2008, 01:04 PM
Hi!!

I was trying to expand/collapse all nodes client side and I saw this page teaching with a very simple code:

http://www.telerik.com/help/aspnet-ajax/tree_clientexpandingcollapsing.html

I was very happy but when I tested it, didn't work. I guess it's because I'm using Q3 and not prometheus. Now, I have three questions:

1. Is there a easy way to do the same with Q3?
2. How can I know, when exploring telerik web page, that I'm at a prometheus help article and not at Q3, since I haven't see any description about it in the page?
3. Where can I find help pages just for Q3?

We still doesn't have the prometheus version here (we depends from the directors to buy), but we have the beta version files here, so we could find that the method get_allNodes() was from Prometheus, analysing the script files.
Thanks in advance and god bless!

5 Answers, 1 is accepted

Sort by
0
Accepted
Paul
Telerik team
answered on 02 Dec 2008, 07:35 AM
Hello Eric,

I guess you are still using the old "Classic" version of RadTreeView for ASP.NET, but you are looking through the documentation of the new AJAX version of the control.

Here's a sample code snippet that shows the needed approach for RadTreeView for ASP.NET.

<form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
 
    <script type="text/javascript">  
    function treeExpandAllNodes()  
    {  
        var tree = <%= RadTreeView1.ClientID %>;  
        var i;  
        for(i=0; i<tree.AllNodes.length; i++)  
        {  
            tree.AllNodes[i].Expand();  
        }  
    }  
 
    function treeCollapseAllNodes()  
    {  
        var tree = <%= RadTreeView1.ClientID %>;  
        var i;  
        for(i=0; i<tree.AllNodes.length; i++)  
        {  
            tree.AllNodes[i].Collapse();  
        }  
    }  
    </script> 
 
    <rad:RadTreeView ID="RadTreeView1" runat="server">  
        <Nodes> 
            <rad:RadTreeNode runat="server" Text="New Item">  
                <Nodes> 
                    <rad:RadTreeNode runat="server" Text="New Item">  
                    </rad:RadTreeNode> 
                    <rad:RadTreeNode runat="server" Text="New Item">  
                    </rad:RadTreeNode> 
                </Nodes> 
            </rad:RadTreeNode> 
            <rad:RadTreeNode runat="server" Text="New Item">  
                <Nodes> 
                    <rad:RadTreeNode runat="server" Text="New Item">  
                    </rad:RadTreeNode> 
                    <rad:RadTreeNode runat="server" Text="New Item">  
                        <Nodes> 
                            <rad:RadTreeNode runat="server" Text="New Item">  
                            </rad:RadTreeNode> 
                            <rad:RadTreeNode runat="server" Text="New Item">  
                                <Nodes> 
                                    <rad:RadTreeNode runat="server" Text="New Item">  
                                    </rad:RadTreeNode> 
                                    <rad:RadTreeNode runat="server" Text="New Item">  
                                    </rad:RadTreeNode> 
                                    <rad:RadTreeNode runat="server" Text="New Item">  
                                    </rad:RadTreeNode> 
                                </Nodes> 
                            </rad:RadTreeNode> 
                            <rad:RadTreeNode runat="server" Text="New Item">  
                            </rad:RadTreeNode> 
                            <rad:RadTreeNode runat="server" Text="New Item">  
                            </rad:RadTreeNode> 
                        </Nodes> 
                    </rad:RadTreeNode> 
                    <rad:RadTreeNode runat="server" Text="New Item">  
                    </rad:RadTreeNode> 
                    <rad:RadTreeNode runat="server" Text="New Item">  
                    </rad:RadTreeNode> 
                </Nodes> 
            </rad:RadTreeNode> 
        </Nodes> 
    </rad:RadTreeView> 
    <href="javascript: treeExpandAllNodes();" class="RadTreeView_Hay">Expand All Nodes</a> 
    <href="javascript: treeCollapseAllNodes();" class="RadTreeView_Hay">Collapse All Nodes</a> 
</form> 

In addition, here's the documentation for RadTreeView for ASP.NET.

Regards,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Eric Santos
Top achievements
Rank 2
answered on 02 Dec 2008, 04:58 PM
It worked perfectly!!
Thank you so much!!!
0
Alaa Majzoub
Top achievements
Rank 2
answered on 24 Oct 2009, 04:18 PM
This looks nice, but how to do it for a tree inside a combo box?

how can i reach the tree?
0
Alaa Majzoub
Top achievements
Rank 2
answered on 24 Oct 2009, 07:27 PM
Nevermind it, i found how here
http://www.telerik.com/help/aspnet-ajax/introduction.html
BTW: is there an offline version of this help? i downloaded some CHM files but they are way less detailed than this link!!!




0
Veselin Vasilev
Telerik team
answered on 26 Oct 2009, 01:05 PM
Hello Alaa Majzoub,

The full package of the CHM files can be found here. The content there is the same as in the online help.

Regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TreeView
Asked by
Eric Santos
Top achievements
Rank 2
Answers by
Paul
Telerik team
Eric Santos
Top achievements
Rank 2
Alaa Majzoub
Top achievements
Rank 2
Veselin Vasilev
Telerik team
Share this question
or