Hi Guys
I read so much post about this specific and done so much test that I think my last chance is to ask you help.
First of all my scenario: I need to hide root node (continuing to display the childrens) as well as internal nodes according to a custom param ShowOnMenu that I added into the web.sitemap.
To achieve results I do web control with two asp.net controlsconfigured in this way
<asp:Menu ID="SiteMenu" runat="server"
DataSourceID="menuDataSource"
ItemWrap="true"
onmenuitemdatabound="MenuItemDataBound"
oninit="MenuInit"
StaticDisplayLevels="20"
ShowStartingNode="false">
</asp:Menu>
<asp:SiteMapDataSource runat="server" ID="menuDataSource" ShowStartingNode="false" />
Overriding the MenuInit and MenuItemDataBound and using the e.Item.Parent.ChildItems.Remove(e.Item); into the bound event, I'm able to strip out the second level menu from the provider without displaying it.
Unfortunately this is not possible with root node, because e.Item.Parent result in a null variable
During my tests I was able to setup the root node to diabled (actually I don't remember how I did) and that is the best solution I achieved.
If, in some other way I remove the Root Node, all the rest of childnodes are skipped as well and that's not what I want.
I was thinking to act on the CSS friendly menu adapter file, trying to identify the custom param, but on that stage there is no direct reference for the XML file loaded into memory, just for the built menu to be rendered.
I was thining to add a CssClassName param to let me operate in the CSS Friendly menu adding some stylesheet rules, but dunno how to do this.
I'm really going into panic. Any idea and useful suggestion?
Thanks