hide child node but keep parent node selected

Last post 10-06-2008 4:02 AM by saif016. 3 replies.

Sort Posts:

  • hide child node but keep parent node selected

    01-15-2007, 3:18 PM

    Old and similar question but couldn't find answer elsewhere. My simple menu is like this:

    Suppliers
    --Sub 1
    --Sub 2

    Within MenuItemDatabound event, I am able to remove Sub 1 and Sub 2 by using additional "visible" attribute in my Web.sitemap. However, I want to keep Suppliers selected so that users know they are still in Suppliers section. Unfortunately i can't find a good solution or any workaround for this. This is really irritating because my project has been delayed since this problem. Am I missing something simple?

     

    Thanks a lot
    --Tran

     

  • Re: hide child node but keep parent node selected

    01-16-2007, 5:30 AM
    Answer
    • All-Star
      17,159 point All-Star
    • Dave Sussman
    • Member since 06-17-2002, 11:53 AM
    • UK
    • Posts 2,368
    • ASPInsiders
      TrustedFriends-MVPs

    I'm presuming that doing

      e.Item.Parent.Selected =

    True

    doesn't work? It probably sets the selected, but that would also set the siteMapPath too. I haven't tried this, but it's what I'm guessing.

    Dave

  • Re: hide child node but keep parent node selected

    01-16-2007, 3:31 PM
    Answer

    setting e.Item.Parent.Selected = True will make that particular node selected always even you are in another page. However, i found another workaround. I have an if statement to check if the current page url is the same with parent node's url. If so, set that parent node selected as you said.

     

  • Re: hide child node but keep parent node selected

    10-06-2008, 4:02 AM
    • Member
      2 point Member
    • saif016
    • Member since 10-06-2008, 4:00 AM
    • Posts 3

    trannguyen182:

    setting e.Item.Parent.Selected = True will make that particular node selected always even you are in another page. However, i found another workaround. I have an if statement to check if the current page url is the same with parent node's url. If so, set that parent node selected as you said.

     

     

    please provide me the code, i'm stuck.......

Page 1 of 1 (4 items)