Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
LevelSelectedStyles Property

Menu::LevelSelectedStyles Property

Gets a MenuItemStyleCollection object that contains the style settings that are applied to the selected menu item based on its level in a Menu control.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[PersistenceModeAttribute(PersistenceMode::InnerProperty)]
public:
property MenuItemStyleCollection^ LevelSelectedStyles {
	MenuItemStyleCollection^ get ();
}

Property Value

Type: System.Web.UI.WebControls::MenuItemStyleCollection
A MenuItemStyleCollection that contains the style settings that are applied to the selected menu item based on its level in a Menu control.

Use the LevelSelectedStyles collection as an alternative to the DynamicSelectedStyle and StaticSelectedStyle properties to control the style of a selected menu item at the individual levels of the menu. The styles contained in this collection are applied to a selected menu item based on its menu level. The first style in the collection corresponds to the style of a selected menu item in the first level of the menu. The second style in the collection corresponds to the style of a selected menu item in the second level of the menu, and so on. This collection is most often used to generate table of contents-style navigation menus where menu items at a certain level should have the same appearance, regardless of whether they have submenus.

NoteNote

If a style is defined for a certain level using the LevelSelectedStyles collection, this overrides the DynamicSelectedStyle and StaticSelectedStyle properties at that level.

The following code example demonstrates how to use the LevelSelectedStyles collection to apply a style setting to the selected menu item in a Menu control based on its level.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft