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

Forums / Designing with Sitefinity / Maximum of menu levels?

Maximum of menu levels?

3 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    01 Nov 2007
    Link to this post
    Hi telerik,

    Can I have the navigation menu show a maximum number of levels?
    I want to see only the root and 1 sublevel in my menu. If I define a second sublevel inside Sitefinity I don't want it to show up inside my navigation.

    I wan to create another 'menu-control' somewhere else on the page that shows this 'second sublevel' only.

    Am I a bit clear? How can I achieve this in Sitefinity?

    Thanks,
    Daniel
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    01 Nov 2007
    Link to this post
    Hello Daniel,

    For example, if you want to display only first level items, add the following code in the RadMenu1_ItemDataBound event handler of your User Control wrapping RadMenu:

    public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e)  
        {  
            ...  
            if (e.Item.Level > 0)  
            {  
                e.Item.Visible = false;  
                e.Item.Owner.Items.Clear();  
            }  
        } 

    For the second level you need to change the check in if construction.

    Also, you could find useful information on this matter in the Developer Manual -> Controls -> RadControls -> Setting RadMenu Hierarchy Depth in a User Control.

    Hope this helps.

    Kind regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    02 Nov 2007
    Link to this post
    Thanks, that worked.

    Daniel
Register for webinar
3 posts, 0 answered