Navigation Control suggestion - Ideas & Feature Requests - Ideas & Feature Requests - Progress Community
 Ideas & Feature Requests

Navigation Control suggestion

  • Navigation Control suggestion
  • When I first started looking at the navigation control, I was happy to see that we could select a set of pages to be used for the navigation. I was quickly disappointed that this option was not available for most of the options for navigation output. I did however find out that if I go to the Advanced mode, I could force the control to use SelectedPages as the SelectionMode property and specify the pages in the CustomSelectedPages property. While this is not the most user friendly way to go about this it worked. One minor drawback is that if someone messes with the "Basic" view, then it will overwrite the settings I manually entered in the Advanced mode.

    While this was great to have the ability to set the pages I wanted to use, I found that there was another problem to this in that it only shows those pages. There is no option to have the child pages for the selected pages show. This was a problem for me as I need to have the child pages show. I was using the "Horizontal with Drop Down Menu" option to have the child pages show as drop down items. But I was stunned to find that it only showed the pages I selected. So I duplicated the NavigationControl control and altered the code a bit. I created a property, ShowChildPages, that when set to true would alter the way the SelectedPages option functioned. The original code created a lit of type SiteMapNode and added the selected pages to this. I just created another variable of type SiteMapNodeCollection and added the same selected pages to it. Then I returned the array or collection depending on whether ShowChildPages was set to true or false. Below is the code that was changed for the select statement in the InitializeSiteMapDataSource method:

    case PageSelectionModes.SelectedPages:
        List<SiteMapNode> list = new List<SiteMapNode>();
        SiteMapNodeCollection collection = new SiteMapNodeCollection();
        foreach (SelectedPage page in this.CustomSelectedPages)
            SiteMapNode node = null;
            if (page.IsExternal)
                node = new SiteMapNode(this._currentSiteMapDataSource.Provider, "ext", page.Url, page.Title);
                node = this._currentSiteMapDataSource.Provider.FindSiteMapNodeFromKey(page.Id);
            if (node != null)
        if (this.ShowChildPages)
            this.CurrentNavigationControl.DataSource = collection;
            this.CurrentNavigationControl.DataSource = list;

    Maybe we can get this added into the NavigationControl some how. We continually have clients asking for a menu that shows only certain pages. While we could set the other pages to non-navigable, we would rather have the ability to have a full sitemap and then only choose which pages we would want to show in a menu.

    One other thing that would be nice to be able to choose between the RadSiteMap control and the RadPanelbar control for the vertical option. Since the Panel Bar has more html elements per item, it gives us more flexibility in the styling that we can offer.
  • +1 for Panelbar

    I had to implement it myself, and so I lose the flexibility of the built-in nav control
  • Hi Steve,

    10x for the suggestion we are going to consider them and try to rewrite the navigation control as soon as possible.

    the Telerik team