This documentation is archived and is not being maintained.

SubMenuStyleCollectionEditor Class

Provides a component editor for the SubMenuStyleCollection object in the associated Menu control.

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

[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
public class SubMenuStyleCollectionEditor : CollectionEditor

The SubMenuStyleCollectionEditor class provides a user interface for editing the SubMenuStyle elements of the SubMenuStyleCollection object in the associated Menu control at design time, under the control of the MenuDesigner object.

There is a SubMenuStyleCollection associated with the LevelSubMenuStyles property of the Menu control. The SubMenuStyleCollection object is used to apply styles to static submenu items that depend on their level (nesting depth) in the menu structure.

The SubMenuStyleCollectionEditor is invoked, for example, by selecting the ellipsis button () on the LevelSubMenuStyles row in the Properties grid of the visual designer.

The CanSelectMultipleInstances method always returns false to indicate that only one object can be selected at a time in the editor. The CreateCollectionForm method creates a new form to display and edit the SubMenuStyleCollection.

The CreateInstance method creates a new instance of the specified collection item type. The CreateNewItemTypes method returns an array of types that the editor can create.

The following code example shows how to use the EditorAttribute attribute to associate the SubMenuStyleCollectionEditor and UITypeEditor (the collection editor base class) classes with a property in a custom control, derived from the WebControl class, that gets and sets a SubMenuStyleCollection collection.

private SubMenuStyleCollection subMenuStyles;

// Associate the SubMenuStyleCollectionEditor with the  
// LevelSubMenuStyles. 
public SubMenuStyleCollection LevelSubMenuStyles
    get { return subMenuStyles; }
    set { subMenuStyles = value; }
} // LevelSubMenuStyles


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0