This is a migrated thread and some comments may be shown as answers.

StaticDisplayLevels ??

10 Answers 281 Views
Menu
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 01 Mar 2008, 06:30 PM

Is it too late to ask/hope that Prometheus release includes the "StaticDisplayLevels" property in the menu control?

I know it's been mentioned a couple times before-- though, I'm surprised not much more.

It'd be convenient to be able to simply replace a "standard" config'd asp menu & sitemap (with Home as rootnode) without additional code to workaround the levels display.

So, speaking of workarounds, what might be a recommended way to use the above sitemap and display the first 2 levels?



Thanks!

David

10 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 03 Mar 2008, 10:16 AM
Hi David,

At the time being RadMenu does not support "static" levels. By static I mean levels which are always visible. What we can implement is binding to specific level. Let us know of your opinion.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
David
Top achievements
Rank 1
answered on 05 Mar 2008, 06:33 AM
Thanks for the reply.

I managed to workaround by creating a custom sitemapdatasource and overriding the GetHierarchicalView method... cloning the root node, add to collection without the kids, and then adding the kids to the collection.

My Opinion?..  I would like to see the "StaticDisplayLevels" property added to the menu control, to avoid having to do the above, and to better "drag n drop" replace the asp:menu contol.

If there's any chance of incorporating before release... that'd be fantastic!

David   :-)

0
Atanas Korchev
Telerik team
answered on 05 Mar 2008, 07:37 AM
Hi David,

Yesterday our developers added a new feature to RadMenu (and the rest of the navigation controls). It is a property called MaxDataBindDepth. You can use that property to limit the number of levels to bind to the control. For example, setting this property to 2 binds only the root menu items and their immediate children. All remaining records in the data source are ignored.

Does it make sense?
Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
David
Top achievements
Rank 1
answered on 05 Mar 2008, 08:10 AM
Hi Albert,

Yes, that makes sense, and  I can see that being useful in certain scenarios, but doesn't apply to the static display.

Could you present this to the developers?

Thanks again!!

David
0
Atanas Korchev
Telerik team
answered on 05 Mar 2008, 09:18 AM
Hi David,

Unfortunately implementing static levels won't be that easy - it would require changes in the rendering and client-side logic.

I have logged static levels as a feature request but I am afraid we won't be able to implement it for the official Q1 2008 release. Based on customer feedback we may introduce static display levels in a future release.

Regards,
Atanas Korchev,
the Telerik dev team

Instantly find answers to your questions at the new Telerik Support Center
0
David
Top achievements
Rank 1
answered on 05 Mar 2008, 03:17 PM
That sounds great!

Thanks!

David
0
Chris
Top achievements
Rank 2
Veteran
answered on 02 Dec 2008, 01:16 PM
Just to add to the record... we'd be interested in the static levels attribute as well or any workaround you've come up with at this point... We're working to create a 2 level deep, all static menu using Rad Menu... will probably use another tool until Rad Menu can do this.

Best Regards,
Chris Reddick
0
David
Top achievements
Rank 1
answered on 17 Dec 2008, 05:33 PM
What I've been doing in my apps.. is just to use a simple Custom SiteMapDatasource for controls requiring display of 2 levels, ie; asp:menu, and the standard SiteMapDataSource for all else reqs.. like:

namespace MyNamespace.Providers 
 
    public class CustomSiteMapDataSource : SiteMapDataSource 
    { 
        public CustomSiteMapDataSource() { } 
 
        protected override HierarchicalDataSourceView GetHierarchicalView(string viewPath) 
        { 
            SiteMapNode root = Provider.RootNode; 
            SiteMapNode rootClone = root.Clone(); 
            SiteMapNodeCollection nodeCollection = new SiteMapNodeCollection(); 
 
            nodeCollection.Add(rootClone); 
            rootClone.ChildNodes = new SiteMapNodeCollection(); 
 
            foreach (SiteMapNode node in root.ChildNodes) 
                nodeCollection.AddRange(RecursiveNodesCheck(node)); 
 
            return new SiteMapHierarchicalDataSourceView(nodeCollection); 
        } 
 
        private SiteMapNodeCollection RecursiveNodesCheck(SiteMapNode Node) 
        { 
            SiteMapNode nodeClone = Node.Clone(); 
            SiteMapNodeCollection OutputCollection = new SiteMapNodeCollection(); 
            SiteMapNodeCollection ChildrenCollection = new SiteMapNodeCollection(); 
 
            foreach (SiteMapNode ChildNode in Node.ChildNodes) 
                ChildrenCollection.AddRange(RecursiveNodesCheck(ChildNode)); 
 
            nodeClone.ChildNodes = ChildrenCollection; 
            OutputCollection.Add(nodeClone); 
            return (OutputCollection); 
        } 
    } 
 
 

Hope that helps!

Maybe Telerik could implement "StaticDisplayLevels" into 2009 Q1 RadMenu.

D  :-)
0
Atanas Korchev
Telerik team
answered on 18 Dec 2008, 07:41 AM
Hi David,

Static display levels is not in our plans for Q1 2009.

Regards,
Atanas Korchev,
the Telerik dev team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jake
Top achievements
Rank 1
answered on 18 Mar 2009, 05:31 PM
We also would like to see StaticDisplayLevels incorporated into a near future release.

There is a nice work-around mentioned in this post: http://www.telerik.com/community/forums/aspnet/menu/horizontal-menu-from-sitemap.aspx

Set the ShowStartingNode property to false, and the menu will display all 1st level children horizontally.  Since I wanted my home page to display in the menu along side the 1st level children, I put a sitemapnode pointing to the home page at the same level as my 1st level children.  I then pointed the root node to my login page (the sitemap provider requires a valid URL for all nodes).

Hope this helps!
Tags
Menu
Asked by
David
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
David
Top achievements
Rank 1
Chris
Top achievements
Rank 2
Veteran
Jake
Top achievements
Rank 1
Share this question
or