hi, i have the following sample on my page. how can i now (on pageload?) hide items of the menu so the will not shown ?
here for example to don't wanna show the second menupoint
<ig:webdatamenu ID="WebDataMenu1" runat="server" StyleSetName="RedPlanet" Width="100%"> <Items> <ig:DataMenuItem Text="employee"> <Items> <ig:DataMenuItem Text="employee1"> <Template> <asp:HyperLink CssClass="igdm_RedPlanetMenuItemVertical" ID="employee2" runat="server" NavigateUrl="~/employee3.aspx">employee</asp:HyperLink> </Template> </ig:DataMenuItem> <ig:DataMenuItem Text="employee4"> <Template> <asp:HyperLink CssClass="igdm_RedPlanetMenuItemVertical" ID="employee5" runat="server" NavigateUrl="~/employee7.aspx">employee8</asp:HyperLink> </Template> </ig:DataMenuItem> </Items> </ig:DataMenuItem>
Hi , i now removed Items with your solution (that works) . but now an other user log in (he has the rights to see the menu item) but the menu item is not there anymore (since i removed it ! )how can i now restore the menuitem ? should i add it new ?
="x1">
>
Hello,
The WebDataMenuItem does not support Visibility property. However on PageLoad you can remove the unwated items from Items collection of the menu:
1. If you want to remove Root level item use this: this.masterMenu.Items.RemoveAt(2);
2. If you want to remove any other level item, you can use this: this.masterMenu.Items[2].Items.RemoveAt(2);
Note that in both cases Items is zero-based-index collection, in which items appear in the order you have put them in the markup. Also that any DataMenuItem has this Items property. You may want to check the ".Count" property of Items, before taking actions over it.
Items property is of type DataMenuItemsCollection.
Hope this helps