More in this section

Forums / Developing with Sitefinity / SiteTreeview expanded view

SiteTreeview expanded view

3 posts, 0 answered
  1. Orion
    Orion avatar
    54 posts
    Registered:
    02 Feb 2009
    01 Jun 2009
    Link to this post
    I'm trying to use the SiteTreeview control for a left navigation and I want it to just always show as expanded.  Using this KB article, http://www.sitefinity.com/support/knowledge-base/kb-article/b1154K-bakb-b1154T-ctt.aspx, I'm attempting to edit  "SiteTreeview.ascx."  I'd rather not build a custom control if possible.  But I'm getting an error message when I copy the edited file over and then refresh my page.  Is there something wrong with the code I'm using?

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="SiteTreeview.ascx.cs" Inherits="UserControls_Nav_SiteTreeview" %>
    <%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>

    <script language="javascript" type="text/javascript">     
                   
        function treeExpandAllNodes()          
        {             
            var i;            
            var treeviewInstance = <%= RadTreeview1.ClientID %>;        
                          
            for (i=0; i < treeviewInstance.AllNodes.length; i++)              
            {               
                if (treeviewInstance.AllNodes[i].Nodes != null)                 
                {                 
                    treeviewInstance.AllNodes[i].Expand();              
                }             
            }          
        }                  
                
        window.onload = treeExpandAllNodes;     
                
    </script>

    <asp:SiteMapDataSource ID="SitemapDataSource1" runat="server" ShowStartingNode="false" />
    <telerik:RadTreeview ID="RadTreeview1" runat="server" OnNodeDataBound="RadTreeview1_NodeBound" DataSourceID="SitemapDataSource1">
    </telerik:RadTreeview>
  2. Orion
    Orion avatar
    54 posts
    Registered:
    02 Feb 2009
    01 Jun 2009
    Link to this post
    I finally got this to work with another thread I found in the forum.
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    02 Jun 2009
    Link to this post
    Hello Orion,

    I am glad to hear that everything is working fine for you. However, here is a forum thread that covers the same scenario http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bemtea.aspx. I hope it will help you if you have missed something.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
3 posts, 0 answered