How to hide root.

6 posts, 0 answers
  1. Ryan C
    Ryan C avatar
    28 posts
    Member since:
    Aug 2009

    Posted 22 Mar 2010 Link to this post

    I would like to display the items from the 2nd level onwards. How can this be accomplished?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Mar 2010 Link to this post

    Hello Ryan,

    I am not quite sure about the scenario. If you want to hide the radmenuItem and want to use the child items, then use the display style setting between none and block. Here is the example of how to perform this.

    C#:
     
    RadMenu1.FindItemByText("Root RadMenuItem1").Style.Add("display""block"); // Show the item 

    JavaScript:
     
    <script type="text/javascript">   
    function Visibility()   
    {   
        var menu = $find("<%= RadMenu1.ClientID %>");   
        var item = menu.findItemByText("Root RadMenuItem1");   
        item.get_element().style.cssText = "display: none;";  // Hide the item 
    }   
    </script>  

    Hope this helps,
    Princy.
  3. Ryan C
    Ryan C avatar
    28 posts
    Member since:
    Aug 2009

    Posted 22 Mar 2010 Link to this post

    Well I'm using an SQL data source to bind with my RadMenu control. And I got the following Structure:

    -->Website Sitemap
    ---> Home
    ---> Products
    ---> Item A
    ---> Item B
    ---> About Us
    ---> Contact Information
    ---> History
    ---> Help

    Now when I view my page with the RadMenu, all I get displayed is "Website Sitemap", is there a featrue where I can start display from the 2nd level, i.e. Home, Products, About Us, Help?
  4. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 22 Mar 2010 Link to this post

    Hello Ryan,

    ASP.NET's and Telerik's SiteMapDataSources have a property ShowStartingNode. Set it to false and you're set.

    Sincerely yours,
    Kamen Bundev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Ryan C
    Ryan C avatar
    28 posts
    Member since:
    Aug 2009

    Posted 22 Mar 2010 Link to this post

    Thanks, but I'm using the SqlDataSource to retrieve my data. Could you point me to some documentation on how to use the RadSiteMapDataSource to get my data from a table in SQL?
  6. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 23 Mar 2010 Link to this post

    Hello Ryan,

    Here is an online demo for reference:

    http://demos.telerik.com/aspnet-ajax/sitemap/examples/datasources/defaultcs.aspx


    All the best,
    Peter
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top