/// <summary>
    /// Recursively populates the TabStrip with the needed pages (nodes) using pNode as root.
    /// </summary>
    /// <param name="pNode">The root node (later used as the current root node in the recursion).</param>
    /// <param name="levelDepth">The current depth of the tree of tabs.</param>
    private void FillTabStrip(SiteMapNode pNode, RadTabCollection pTabs, int levelDepth)
    {
        int levelPosition = -1;

        foreach (CmsSiteMapNode node in pNode.ChildNodes)
        {
            levelPosition++;

            RadTab tab = new RadTab(node.Title);
            tab.NavigateUrl = node.Url;
            pTabs.Add(tab);
            if (node == SiteMap.CurrentNode)
            {
                tab.Selected            = true;
                tab.Owner.SelectedIndex = levelPosition;
            }

            if (levelDepth > this.HierarchyDepth && this.HierarchyDepth != -1)
            {
                tab.Visible = false;
            }

            if (levelDepth == this.HideLevel)
            {
                tab.Style.Add(HtmlTextWriterStyle.Display, "none");
            }

            this.FillTabStrip(node, tab.Tabs, levelDepth + 1);

            if (tab.SelectedIndex >= 0)
            {
                tab.Owner.SelectedIndex = levelPosition;
            }
        }
    }
 private bool SetCurrentTab(RadTabCollection coll, string value)
 {
     foreach (RadTab tab in coll)
     {
         if (value.Equals(tab.Value))
         {
             tab.Selected = true;
             tab.SelectParents();
             return true;
         }
         if (SetCurrentTab(tab.Tabs, value))
             return true;
     }
     return false;
 }
Beispiel #3
0
 private bool SetCurrentTab(RadTabCollection coll, string value)
 {
     foreach (RadTab tab in coll)
     {
         if (value.Equals(tab.Value))
         {
             tab.Selected = true;
             tab.SelectParents();
             return(true);
         }
         if (SetCurrentTab(tab.Tabs, value))
         {
             return(true);
         }
     }
     return(false);
 }
    /// <summary>
    /// Recursively populates the TabStrip with the needed pages (nodes) using pNode as root.
    /// </summary>
    /// <param name="pNode">The root node (later used as the current root node in the recursion).</param>
    /// <param name="levelDepth">The current depth of the tree of tabs.</param>
    private void FillTabStrip(SiteMapNode pNode, RadTabCollection pTabs, int levelDepth)
    {
        int levelPosition = -1;
        foreach (CmsSiteMapNode node in pNode.ChildNodes)
        {
            levelPosition++;

            RadTab tab = new RadTab(node.Title);
            tab.NavigateUrl = node.Url;
            pTabs.Add(tab);
            if (node == SiteMap.CurrentNode)
            {
                tab.Selected = true;
                tab.Owner.SelectedIndex = levelPosition;
            }

            if (levelDepth > this.HierarchyDepth && this.HierarchyDepth != -1)
                tab.Visible = false;

            if (levelDepth == this.HideLevel)
                tab.Style.Add(HtmlTextWriterStyle.Display, "none");

            this.FillTabStrip(node, tab.Tabs, levelDepth + 1);

            if (tab.SelectedIndex >= 0)
                tab.Owner.SelectedIndex = levelPosition;
        }
    }