+1-888-365-2779
Try Now
More in this section

Forums / Suggestions / Navigation Control suggestion

Navigation Control suggestion

3 posts, 0 answered
  1. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    17 Feb 2011
    Link to this post
    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);
            }
            else
            {
                node = this._currentSiteMapDataSource.Provider.FindSiteMapNodeFromKey(page.Id);
            }
            if (node != null)
            {
                list.Add(node);
                collection.Add(node);
            }
        }
        if (this.ShowChildPages)
            this.CurrentNavigationControl.DataSource = collection;
        else
            this.CurrentNavigationControl.DataSource = list;
        return;
    }


    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.
  2. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    21 Feb 2011
    Link to this post
    +1 for Panelbar

    I had to implement it myself, and so I lose the flexibility of the built-in nav control
  3. Teodor
    Teodor avatar
    52 posts
    Registered:
    24 Sep 2012
    23 Feb 2011
    Link to this post
    Hi Steve,

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

    Greetings,
    Teodor
    the Telerik team
3 posts, 0 answered