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

Forums / Set-up & Installation / RadMenu Depth

RadMenu Depth

16 posts, 0 answered
  1. Chris
    Chris avatar
    6 posts
    Registered:
    18 Jun 2007
    22 Aug 2007
    Link to this post
    Is there a way to set the depth under the Edit Properties window in a template?
  2. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    23 Aug 2007
    Link to this post
    Hello Alex,

    I am not exactly sure what you mean by "set the depth". If you want to display only certain levels from the site map, for example only 2nd level and deeper, you can do it like this:

    1. Use SiteMenu control
    2. From Edit Properties, set the StartingNodeOffset property to 1.

    This would cause the menu to display pages one level deeper than the starting level. If you don't want to display a navigation menu, but some other information, then you would have to do it in the DataSource that the menu is bound to.

    Let me know if this helps.

    Best wishes,
    Slavo
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Chris
    Chris avatar
    6 posts
    Registered:
    18 Jun 2007
    23 Aug 2007
    Link to this post
    Sorry to be vague... I'd like the radMenu to only display the root level pages from the sitemap.
  4. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    23 Aug 2007
    Link to this post
    Hello Alex,

    The SiteMenu control has a property called LastExpandLevel. By default it is set to 0, meaning that all levels will be expanded. If you want to display the first level only and hide the subsequent levels, then set the property to 1. This should do the trick.

    Kind regards,
    Slavo
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Chris
    Chris avatar
    6 posts
    Registered:
    18 Jun 2007
    23 Aug 2007
    Link to this post
    Cool! Thanks very much.
  6. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    23 Jan 2008
    Link to this post
    Hi Guys,

    I hate to be the bearer of bad news (especially since it is you Telerik who created the RadMenu) but I don't think the Databindings Implementation you are using to implement the LastExpandLevel property is designed for what you are trying to achieve in terms of Depth.

    Let me explain.... if you look at this example of the RadMenu you can see the the Depth property of databinding is only being used to format that particular level.

    The way you are currently using it the Menu doesn't limit, well not exactly.  The text isn't rendered past that depth but the actual menu items still get rendered in the HTML.  So what I end up with once I apply a skin is the Root Menu items get rendered but when you hover over any items that have sub pages you can see the slide out appear (if styled in a way it can be seen).  So what would be good would be for it to actually completely not render any child items past that depth.

    I will in the meantime find a different approach to solve this.

    Thought I would let you know  in case you didn't ;)

    Sean
     
  7. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    25 Jan 2008
    Link to this post
    Hi Sean,

    You are right that there is a problem in case you use the RadMenu Depth property - the text of the item does not render but it still expands. The workaround is to iterate through the menu items and clear the children for a given level. The following example will clear the children of the items with a level greater than 2:

     
    foreach(RadMenuItem item in RadMenu1.GetAllItems()) 
       if(item.Level > 2) 
          item.Items.Clear(); 

    Hope this is helpful for you.

    Sincerely yours,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    28 Jan 2008
    Link to this post
    Thanks Pepi,

    I had already figured something similar out but just hadn't found the time to post my code.

    Kind Regards

    Sean
  9. Mike
    Mike avatar
    22 posts
    Registered:
    05 Mar 2008
    21 Apr 2008
    Link to this post
    Great solution, but i would really like to know WHERE to put this magical foreach loop so that the menu control WORKS correctly.

    Would it be possible to get this implemented in the next hotfix/patch/version?
  10. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    21 Apr 2008
    Link to this post
    Hi Mike,

    I guess someone should have clarified this :)

    I was using it in the SiteMenu control (~/Sitefinity/UserControls/Navigation/SiteMenu.ascx.cs), but this can go in the code behind of any UserControl that has a RadMenu in it.  It needs to be done in the DataBound event of the menu or anytime after the RadMenu has had its items Collection filled.

    Cheers
    Sean
  11. Mike
    Mike avatar
    22 posts
    Registered:
    05 Mar 2008
    21 Apr 2008
    Link to this post
    awesome.. Thanks Sean!  thats the missing piece.
  12. Eric
    Eric avatar
    23 posts
    Registered:
    01 Aug 2007
    20 Nov 2008
    Link to this post
    The LastExpandLevel property does not appear to work in Sitefinity 3.5 SP1.
    Telerik.Web.UI version is 2008.2.1001.20.


    An unrelated issue I thought I would mention since I was unable to find any documentation anywhere is that RadRotator no longer has a ContentFile property.
  13. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    24 Nov 2008
    Link to this post
    Hi Eric,

    I just tested the LastExpandLevel property with the SiteMenu control and it was working just fine. Here are the steps I took:
    1. Created the following structure
    root
      |_test1
           |_test2
    2. I set LastExpandedLevel to 1, and publish the page - only root->test1 was showed.
    3. I set the same property to 3 - all levels were shown on mouse over. Can you confirm the problem with this steps on your end?

    As the RadRotator, the ContentFile property was typical only for the classic controls. The Ajax version does not have such property indeed. You may use XmlDataSource to show the XML file contents. For more information, please refer to http://demos.telerik.com/aspnet/prometheus/Rotator/Examples/Testimonial/DefaultCS.aspx

    Sincerely yours,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  14. Eric
    Eric avatar
    23 posts
    Registered:
    01 Aug 2007
    24 Nov 2008
    Link to this post
    I should have been more specific. I only want the root items to show (for now). So the structure would be:

    Home

    Company
     | Company_Subpage 1
     | Company_Subpage 2

    Solutions
     | Solutions_Subpage 1
     | Solutions_Subpage 2
     | Solutions_Subpage 3

    So from the above, I only want Home, Company and Solutions showing...no sub-menus. This was possible in previous versions.
  15. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    25 Nov 2008
    Link to this post
    Hello Eric,

    If I understand correctly you want to achieve the described functionality with Sitefinity SiteMenu control. If it is so, then try the following:

    1. Click Edit to open SiteMenu property window.
    2. Expand section Misc and click Edit button next to Menu field - RadMenu property window opens.
    3. Expand the
    Data section and type 1 for MaxDataBindDepth property.
    5. Click I'm done to save the changes.

    Do let us know if this helps.

    All the best,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  16. Eric
    Eric avatar
    23 posts
    Registered:
    01 Aug 2007
    25 Nov 2008
    Link to this post
    That did the trick! You tha man Pepi. Thanks.
Register for webinar
16 posts, 0 answered