示例#1
0
 /// <remarks>
 /// The event handler is used to enable the feature of hiding the url for a group
 /// page PanelItem. The type of the page corresponding to the current node is checked and
 /// if it is a group page, the url for the CmsSiteMapNode is set to an empty string.
 /// </remarks>
 /// <summary>
 /// A handler for the <strong>RadPanelbar</strong> ItemDataBound event. Performs
 /// hiding of URLs for group pages, if the <strong>HideUrlForGroupPages</strong> property
 /// is <strong>true</strong>.
 /// </summary>
 /// <param name="sender">The object that caused the event.</param>
 /// <param name="e">
 /// An instance of the RadPanelbarEventArgs class containing information about the
 /// event.
 /// </param>
 public void RadPanelbar1_ItemDataBound(object sender, RadPanelBarEventArgs e)
 {
     if (this.hideUrlForGroupPages)
     {
         CmsSiteMapNode node = e.Item.DataItem as CmsSiteMapNode;
         if (node != null && node.PageType == CmsPageType.Group)
         {
             e.Item.NavigateUrl = "";
         }
     }
 }
示例#2
0
    /// <summary>
    /// A handler for the <strong>RadMenu</strong> ItemDataBound event. Performs hiding
    /// of URLs for group pages, if the <strong>HideUrlForGroupPages</strong> property is
    /// <strong>true</strong>.
    /// </summary>
    /// <remarks>
    /// The event handler is used to enable the feature of hiding the url for a group
    /// page MenuItem. The type of the page corresponding to the current node is checked and if
    /// it is a group page, the url for the CmsSiteMapNode is set to an empty string.
    /// </remarks>
    /// <param name="sender">The object that caused the event.</param>
    /// <param name="e">
    /// An instance of the RadMenuEventArgs class containing information about the
    /// event.
    /// </param>
    public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e)
    {
        if (this.hideUrlForGroupPages)
        {
            CmsSiteMapNode node = e.Item.DataItem as CmsSiteMapNode;
            if (node != null)
            {
                // save the PageID in the attributes of the menu item
                e.Item.Attributes.Add("PageID", node.Key);

                if (node.PageType == CmsPageType.Group)
                {
                    e.Item.NavigateUrl = "";
                }
            }
        }
    }
示例#3
0
    /// <summary>A handler for the <strong>RadTreeview</strong> NodeBound event.</summary>
    /// <param name="o">The object that caused the event.</param>
    /// <param name="e">
    /// An instance of the RadTreeviewEventArgs class containing information about the
    /// event.
    /// </param>
    public void RadTreeview1_NodeBound(object o, RadTreeNodeEventArgs e)
    {
        CmsSiteMapNode currentNode = SiteMap.CurrentNode as CmsSiteMapNode;

        if (currentNode != null && currentNode.ParentNode != null)
        {
            while (currentNode != null && currentNode.ParentNode != SiteMap.RootNode)
            {
                RadTreeNode item2 = this.RadTreeview1.FindNodeByUrl(this.ResolveUrl(currentNode.Url));
                if (item2 != null)
                {
                    item2.Selected = true;
                }

                currentNode = currentNode.ParentNode as CmsSiteMapNode;
            }
        }
    }
示例#4
0
    /// <summary>
    /// Overriden. Used to populate the tab strip with pages data.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.ShowOnlyFirstLevel)
        {
            SiteMapNode rootNode = SiteMap.RootNode;
            foreach (SiteMapNode node1 in rootNode.ChildNodes)
            {
                RadTab tab = new RadTab();
                tab.Text        = node1.Title;
                tab.NavigateUrl = node1.Url;
                this.RadTabstrip1.Tabs.Add(tab);
            }

            CmsSiteMapNode currentNode = SiteMap.CurrentNode as CmsSiteMapNode;

            if (currentNode != null && currentNode.ParentNode != null)
            {
                while (currentNode.ParentNode != rootNode)
                {
                    CmsSiteMapNode tempNode = currentNode.ParentNode as CmsSiteMapNode;
                    if (tempNode == null)
                    {
                        break;
                    }
                    currentNode = tempNode;
                }
                RadTab item = this.RadTabstrip1.FindTabByUrl(this.ResolveUrl(currentNode.Url));
                if (item != null)
                {
                    // here you can set the style for the top-level item
                    item.Selected = true;
                }
            }
            else if (this.RadTabstrip1.Tabs.Count > 0)
            {
                this.RadTabstrip1.Tabs[0].Selected = true;
            }
        }
        else
        {
            SiteMapNode root = this.GetStartingNode();
            FillTabStrip(root, this.RadTabstrip1.Tabs, 0);
        }
    }