RadMenuItem
Represents a selectable option displayed on a RadMenuElement or in a drop down panel.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[ComVisible(false)]
[RadNewItem("Add New Item", true)]
public class RadMenuItem : RadMenuItemBase, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IButtonControl, IImageElement, IHierarchicalItem, IItemsOwner, ISiteProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemRadButtonItemRadMenuItemBaseRadMenuItem...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadMenuItem class.
public RadMenuItem()
Initializes a new instance of the RadMenuItem class using the displayed text.
Fields
Command that selects a menu item and opens its child popup.
public static readonly ActivateMenuItemCommand ActivateMenuItemCommand
Identifies the toggle-state property bound to the menu item's checkmark.
public static RadProperty CheckStateProperty
Identifies the property used for the font of the menu item's description text.
public static RadProperty DescriptionFontProperty
Identifies the read-only visibility state, which is coerced from whether DescriptionText is non-empty.
public static RadProperty DescriptionTextVisibleProperty
Identifies the property that supplies the shortcut or hint text displayed beside the menu item's label.
public static RadProperty HintTextProperty
Identifies the property that controls whether a submenu arrow is displayed.
public static RadProperty ShowArrowProperty
Properties
Gets or sets the name of the control for use by accessibility client applications.
public override string AccessibleName { get; set; }
Overrides:
Gets the BorderPrimitive of RadMenuItem responsible for appearance of the border.
[Browsable(true)]
public BorderPrimitive BorderPrimitive { get; }
Gets or sets a value indicating whether a menu item should toggle its CheckState on mouse click.
[Browsable(true)]
public bool CheckOnClick { get; set; }
Gets or sets the font of the descrition text of the RadMenuItem.
public virtual Font DescriptionFont { get; set; }
Gets or sets the description text associated with this item.
[Browsable(true)]
[Bindable(true)]
[SettingsBindable(true)]
public string DescriptionText { get; set; }
Gets the visibility of description text element
public virtual bool DescriptionTextVisible { get; }
Gets the FillPrimitive of RadMenuItem responsible for the background appearance.
[Browsable(true)]
public FillPrimitive FillPrimitive { get; }
Gets or sets the text that appears as a HintText for a menu item.
[Browsable(true)]
public string HintText { get; set; }
Gets or sets the index value of the image that is displayed on the item.
[Browsable(true)]
[RelatedImageList("OwnerControl.ImageList")]
public override int ImageIndex { get; set; }
Overrides:
Gets or sets the key accessor for the image in the ImageList.
[Browsable(true)]
[RelatedImageList("OwnerControl.ImageList")]
public override string ImageKey { get; set; }
Overrides:
Gets or sets a value indicating whether the menu item is checked.
[Browsable(true)]
[Bindable(true)]
public virtual bool IsChecked { get; set; }
Gets the composite layout that contains this item's image, checkmark, text, description, shortcut, and arrow elements.
public virtual RadMenuItemLayout Layout { get; }
Gets the visual element used in the menu item's left column: its image when present, otherwise its checkmark.
public virtual RadElement LeftColumnElement { get; }
Gets the nearest containing drop-down menu layout, or null when the item is not in a drop-down.
public virtual RadDropDownMenuLayout MenuLayout { get; }
Gets or sets the position of a merged item within the current menu.
[Browsable(true)]
public int MergeIndex { get; set; }
Gets the submenu-arrow element used in the menu item's right column, or null before layout creation.
public virtual RadElement RightColumnElement { get; }
Gets or sets if the arrow is shown when the menu item contains sub menu.
[Browsable(true)]
public bool ShowArrow { get; set; }
Gets or sets the visibility of the separator element between the text and the description text
public virtual ElementVisibility TextSeparatorVisibility { get; set; }
Gets or sets the Telerik.WinControls.Enumerations.ToggleState?text=toggle ++++++++++++++++state. Toggle state enumeration defines the following values: Off, Indeterminate, and On.
[Browsable(true)]
[Bindable(true)]
public ToggleState ToggleState { get; set; }
Methods
Handles shortcuts only when the item is enabled, in a valid state, and belongs to the active form or a context menu.
protected override bool CanHandleShortcut(ShortcutEventArgs e)
Overrides:
Coerces DescriptionTextVisible to match whether the description text is non-empty.
protected override object CoerceValue(RadPropertyValue propVal, object baseValue)
Overrides:
Creates the menu item's background, border, and composite layout, then binds the layout elements to the item's properties.
protected override void CreateChildElements()
Overrides:
Removes the child-item collection handler before delegating resource disposal to the base class.
protected override void DisposeManagedResources()
Overrides:
Determines whether the arrow is currently displayed for this item.
Sets the menu-item theme class after applying the base item defaults.
protected override void InitializeFields()
Overrides:
Refreshes submenu-arrow visibility when child items are inserted, replaced, removed, or cleared.
protected virtual void ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
Toggles the item's check state on click only when it is in a drop-down and CheckOnClick is enabled.
Subscribes to child-item collection changes so the submenu arrow reflects whether children are present.
protected override void OnDropDownCreated()
Overrides:
Synchronizes the checkmark, submenu arrow, and shortcut display with changes to their related item properties.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Overrides:
Raises the ToggleStateChanged event.
protected virtual void OnToggleStateChanged(StateChangedEventArgs e)
Raises the ToggleStateChanging event.
protected virtual void OnToggleStateChanging(StateChangingEventArgs e)
Maps a submenu popup direction to the arrow direction used by the menu item. Left and right popup directions map to a left-pointing arrow; up and down map to a downward arrow.
protected virtual ArrowDirection TranslateArrowDirection(RadDirection dropdownDirection)
The direction in which the child popup opens.
Returns:The arrow direction to display.
Updates the displayed hint from the item's shortcuts, clearing the hint when no shortcuts are assigned.
protected override void UpdateOnShortcutsChanged()
Overrides:
Events
Occurs when the item's toggle state changes.
[Browsable(true)]
public event StateChangedEventHandler ToggleStateChanged
Occurs before the item's toggle state changes.
[Browsable(true)]
public event StateChangingEventHandler ToggleStateChanging