开发者

Infragistics UltraWebMenu submenu hidding

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

开发者_StackOverflow

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜