how to edit sublevel node unordered list?

2 posts, 0 answers
  1. Paul
    Paul avatar
    32 posts
    Member since:
    Mar 2011

    Posted 01 Nov Link to this post

    I am implementing the sitemap. When you add a child node, within the parent node it adds an unordered list with the class="rsmList rsmLevel1". I want to edit the unordered list that gets created to hold the child node to append a class to it like:

    <ul class="rsmList rsmLevel1 newClass"></ul>

     

    However, it seems like I can only edit the class of either the parent <li> or the child <li> node. Is there a way to edit the class of the <ul> that gets grouped with the child node?

  2. Rumen
    Admin
    Rumen avatar
    14081 posts

    Posted 06 Nov Link to this post

    Hi Paul,

    Thank you for your question.

    Can you please explain the whole scenario in more detail so that we get a better idea what you'd like to achieve?

    The sitemap is a basic component which does not offer Server-side API for applying custom classes over the UL nodes. The provided CssClass is applied to the <li> elements:

    		protected void SiteMap1_DataBound(object sender, EventArgs e)
    		{
    			foreach (RadSiteMapNode node in SiteMap1.GetAllNodes())
    			{
    				int childNodes = CountChildNodes(node);
                                    node.CssClass = "MyClass";
    			}
    		}

    If you want to apply a custom class over the UL elements or a specific UL element, you'll need to do it on the client. You can use the pageLoad() { } event of the MS AJAX framework, get reference to the li element with a class of "rsmList rsmLevel1", go to its parent element and apply the className="newClass" to it.

    Best Regards,
    Rumen
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top