Horizontal navigation with tabs - preventing level 2 from always showing
I'm trying to create a horizontal navigation with a second level of child pages expanding under the first level. I'm getting most of what I can out of the OOTB horizontal navigation with tabs.
The problem is, if I'm on a child page, that 2nd level of pages in the navigation stays open. I do not want this to stay open, but rather close (only expanding if the mouse is over it). I've attached a screenshot. Basically, if I'm on the "Resource Center" page or any of its children, I DON'T want the set of child pages to show.
Is this possible with minimal customization? Thanks.
Hi Ryan,
This is a default behavior of the SiteMapNavigationTabStrip control (one of the views of the navigation control). On TabDataBound Selected = true is set to all tabs that are parents of the current page (including the current page), which expands them. What you can do is set a template to the default navigation (from the designer, as in the attached image) and on a later event set Selected to false for all tabs, which will collapse them. I have attached a sample template. Place it in your project and set the relative path to it in the Navigation control template path.
Regards,
Jen Peleva
Telerik
Hi Jen,
Thanks for your solution. Now the menu layers are hidden on page load.
But still there is issue on click each tabs. Menu layers not closing , when we click any where outside.
Also when we open the two layers of menus and shift between the two tabs. Two layered menus which was opened before is not closing. Please advice.
Thanks,
Nat