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);
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
;
+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.
Greetings,
Teodor
the Telerik team