Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

MenuItemStyleCollectionEditor Class

Note: This class is new in the .NET Framework version 2.0.

Provides a component editor for MenuItemStyleCollection objects in the associated Menu control.

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

public class MenuItemStyleCollectionEditor : CollectionEditor
public class MenuItemStyleCollectionEditor extends CollectionEditor
public class MenuItemStyleCollectionEditor extends CollectionEditor

The MenuItemStyleCollectionEditor class provides a user interface for editing the MenuItemStyle elements of MenuItemStyleCollection objects in the associated Menu control at design time, under the control of the MenuDesigner object.

There is a MenuItemStyleCollection associated with each of the LevelMenuItemStyles and LevelSelectedStyles properties of the Menu control. These MenuItemStyleCollection objects are used to apply styles to menu items that depend on their level (nesting depth) in the menu structure.

The MenuItemStyleCollectionEditor is invoked, for example, by selecting the ellipsis button () on the LevelMenuItemStyles or LevelSelectedStyles 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 current MenuItemStyleCollection.

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 MenuItemStyleCollectionEditor and UITypeEditor classes (the collection editor base class) with a property in a custom control, derived from the WebControl class, that gets and sets a MenuItemStyleCollection collection.

private MenuItemStyleCollection menuItemStyles;

// Associate the MenuItemStyleCollectionEditor with the 
// LevelMenuItemStyles. 
[Editor(typeof(System.Web.UI.Design.WebControls.
    MenuItemStyleCollectionEditor),
    typeof(UITypeEditor))]
public MenuItemStyleCollection LevelMenuItemStyles
{
    get { return menuItemStyles; }
    set { menuItemStyles = value; }
} // LevelMenuItemStyles

System.Object
   System.Drawing.Design.UITypeEditor
     System.ComponentModel.Design.CollectionEditor
      System.Web.UI.Design.WebControls.MenuItemStyleCollectionEditor
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 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.