views:

186

answers:

1

I have an UltraWebMenu that is attached to a SiteMap file.

One of the menu items is a solitary item with child items that I do not want to show. How do I go about hiding that submenu for that parent item on hover?

A: 

If I understand you right, you still want the parent element to show, you just don't want any children to show up under it.

If that's the case, try using the OnMenuItemDataBound event. If you add a special tag to the items you don't want to show like , then in your method you could do somethign like follows.

protected void Menu1_MenuItemDataBound(object sender, MenuEventArgs e)
        {
            SiteMapNode siteMapNode = (SiteMapNode)e.Item.DataItem;

            string visable = siteMapNode["visable"];
            if (!string.IsNullOrEmpty(visable) && !bool.Parse(visable))
                e.Item.ChildItems.Clear();
        }

That will clear all the child notes when the menu is data bound, but will still show the original item itself.

Tyanna
Im going to try this, thank you. I will let you know if it works.
mattgcon