RadDropDownMenu
Represents a drop-down menu control that can be used as a popup menu for various UI elements. Provides functionality for displaying menu items with support for hierarchical menus, animations, and keyboard navigation.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[RadToolboxItem(false)]
public class RadDropDownMenu : RadItemsPopupControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, IPopupControl, IItemsControl
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadPopupControlBaseRadItemsPopupControlRadDropDownMenu...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadDropDownMenu class with no owner element.
public RadDropDownMenu()
Initializes a new instance of the RadDropDownMenu class with the specified owner element.
public RadDropDownMenu(RadElement ownerElement)
The RadElement that represents the owner of this drop-down menu, or null if no owner is specified.
Properties
This property is not relevant for this class.
[Browsable(false)]
public bool CausesValidation { get; set; }
Gets the item that has been clicked. This property is valid when the drop-down is closed by an item click.
public RadItem ClickedItem { get; }
Gets or sets the image displayed in the header column of the menu.
public Image HeaderImage { get; set; }
Gets or sets the text displayed in the header column of the menu.
public string HeaderText { get; set; }
Gets or sets a value indicating whether the drop-down menu contains one or two columns of items. This property is currently not implemented and always returns false.
public virtual bool IsTwoColumnMenu { get; set; }
Gets or sets the popup element that contains the menu items and provides the visual representation of the drop-down menu.
public RadElement PopupElement { get; set; }
Gets the root component tree handler by traversing up the popup ownership hierarchy to find the topmost control's tree handler.
public IComponentTreeHandler RootTreeHandler { get; }
Gets or sets the theme class name for the drop-down menu. The theme class name resolution follows a hierarchy: checking owner inheritance, local settings, owner control theme capability, and finally the default class name.
public override string ThemeClassName { get; set; }
Overrides:
Gets or sets a value indicating whether the drop-down menu should be displayed at the current mouse cursor position instead of being anchored to the OwnerElement. The OwnerElement is still used for DPI scaling, theming and binding context resolution.
public bool UseMousePosition { get; set; }
Methods
Determines whether the popup can be closed for the specified reason, considering owner element state and mouse interaction.
public override bool CanClosePopup(RadPopupCloseReason reason)
The reason for closing the popup.
Returns:True if the popup can be closed; otherwise, false.
Overrides:
Determines whether the specified menu item can be processed for user interaction.
protected virtual bool CanProcessItem(RadMenuItemBase menuItem)
The menu item to evaluate.
Returns:True if the menu item is not null and is enabled; otherwise, false.
Determines whether the drop-down menu can process the specified mnemonic character.
Checks whether navigation is possible with the specified key based on the current selection and menu state.
Recursively checks whether the specified mnemonic character can be processed by the items control or its child menus.
protected virtual bool CheckCanProcessMnemonic(IItemsControl itemsControl, char keyData)
The items control to check for mnemonic processing capability.
keyDatacharThe character to evaluate for mnemonic processing.
Returns:True if the character can be processed as a mnemonic; otherwise, false.
Determines whether this control defines the theme for the specified element, considering owner inheritance and element type.
public override bool ControlDefinesThemeForElement(RadElement element)
The element to evaluate for theme definition.
Returns:True if this control defines the theme for the element; otherwise, false.
Overrides:
Creates an accessibility object for the drop-down menu to support assistive technologies.
protected override AccessibleObject CreateAccessibilityInstance()
A new RadDropDownMenuAccessibleObject if accessibility is enabled; otherwise, the base accessibility object.
Overrides:
Creates the popup element that will contain the menu items for the drop-down menu.
protected virtual RadElement CreatePopupElement()
A new RadDropDownMenuElement configured as the popup container.
Releases the unmanaged resources used by the RadDropDownMenu and optionally releases the managed resources.
protected override void Dispose(bool disposing)
True to release both managed and unmanaged resources; false to release only unmanaged resources.
Overrides:
Handles the clicking action on a menu item, managing selection, popup closure, and child menu display.
protected virtual void DoOnItemClicked(RadMenuItemBase menuItem, MouseEventArgs e)
The menu item that was clicked.
eMouseEventArgsThe mouse event arguments.
Ensures that an enabled item is selected by cycling through items in the specified direction until an enabled item is found.
Gets the menu item at the specified location by traversing up the element tree.
protected RadMenuItemBase GetMenuItemAtPoint(Point location)
The location to search for a menu item.
Returns:The RadMenuItemBase at the specified location, or null if no menu item is found.
Gets the screen location of the owner element used for positioning the drop-down menu.
protected virtual Point GetOwnerScreenLocation()
The screen coordinates of the owner element.
Initializes the child elements of the drop-down menu, setting up the root element properties and creating the popup element if necessary.
protected virtual void InitializeChildren()
protected override void OnDropDownClosed(RadPopupClosedEventArgs args)
Overrides:
Handles item deselection events, updating the selected state of the menu item.
protected override void OnItemDeselected(ItemSelectedEventArgs args)
The item selection event arguments.
Overrides:
Handles changes to the menu items collection, updating hierarchy relationships and ownership.
protected virtual void OnItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
The collection that was changed.
targetRadItemThe menu item that was affected by the change.
operationItemsChangeOperationThe type of change operation that occurred.
Handles item selection events, updating the selected state and accessibility notifications.
protected override void OnItemSelected(ItemSelectedEventArgs args)
The item selection event arguments.
Overrides:
Handles the load event for the drop-down menu, setting up image list and binding context from the owner element if available.
protected override void OnLoad(Size desiredSize)
The desired size for the menu.
Overrides:
Handles mouse down events for the drop-down menu, processing menu item interactions and child drop-down display.
protected override void OnMouseDown(MouseEventArgs e)
The mouse event arguments.
Overrides:
Handles mouse move events for the drop-down menu, managing item selection and child menu timing.
protected override void OnMouseMove(MouseEventArgs e)
The mouse event arguments.
Overrides:
Handles mouse wheel events to scroll the menu content when the vertical scrollbar is visible.
Fires when the popup is about to open.
protected override void OnPopupOpening(CancelEventArgs args)
A CancelEventArgs object that contains information about the event
Overrides:
Handles screen tip needed events by delegating to the root owner control in the hierarchy.
protected override void OnScreenTipNeeded(object sender, ScreenTipNeededEventArgs e)
The source of the event.
eScreenTipNeededEventArgsThe screen tip needed event arguments.
Overrides:
Handles tooltip text needed events by delegating to the root owner control in the hierarchy.
protected override void OnToolTipTextNeeded(object sender, ToolTipTextNeededEventArgs e)
The source of the event.
eToolTipTextNeededEventArgsThe tooltip text needed event arguments.
Overrides:
Performs a click action on the specified menu item, handling child menu expansion or popup closure as appropriate.
protected void PerformItemClick(RadMenuItemBase menuItem)
The menu item to perform the click action on.
Performs the click action on a menu item if conditions are met (not in design time and not under mouse).
protected virtual void PerformMenuItemClick(RadMenuItemBase menuItem)
The menu item to perform the click action on.
Processes left and right navigation keys for expanding/collapsing child menus and closing parent menus.
Processes up and down navigation keys, selecting the appropriate item in the specified direction.
Sets the visible state of the control, managing popup positioning and selection state.
protected override void SetVisibleCore(bool value)
True to make the control visible; false to hide it.
Overrides:
Displays the RadDropDownMenu in its default position.
public void Show()
Displays the RadDropDownMenu relative to the specified control at the given offset coordinates.
Displays the RadDropDownMenu relative to the specified control with the given popup direction.
public void Show(Control control, Point point, RadDirection popupDirection)
The control that serves as the reference point for positioning the menu.
pointPointThe offset from the control's location where the menu should be displayed.
popupDirectionRadDirectionThe direction in which the menu should open.
Displays the RadDropDownMenu relative to the specified control at the given offset point.
Displays the RadDropDownMenu at the specified screen coordinates.
Displays the RadDropDownMenu at the specified screen location with the specified popup direction.
public void Show(Point point, RadDirection popupDirection)
The screen coordinates where the menu should be displayed.
popupDirectionRadDirectionThe direction in which the menu should open.
Displays the RadDropDownMenu at the specified screen location.
public void Show(Point point)
The screen coordinates where the menu should be displayed.
Displays the RadDropDownMenu relative to the specified RadItem at the given offset coordinates.
Displays the RadDropDownMenu relative to the specified RadItem with the specified direction and owner offset.
public void Show(RadItem item, int ownerOffset, RadDirection popupDirection)
The RadItem that serves as the reference point for positioning the menu.
ownerOffsetintThe offset from the owner element, in pixels.
popupDirectionRadDirectionThe direction in which the menu should open.
Displays the RadDropDownMenu relative to the specified RadItem with the given popup direction.
public void Show(RadItem item, Point point, RadDirection popupDirection)
The RadItem that serves as the reference point for positioning the menu.
pointPointThe offset from the item's location where the menu should be displayed.
popupDirectionRadDirectionThe direction in which the menu should open.
Displays the RadDropDownMenu relative to the specified RadItem at the given offset point.
Core implementation for displaying the drop-down menu at the specified location with the given direction and offset. Handles DPI scaling, theme setup, layout calculation, and popup positioning.
protected virtual void ShowCore(Point point, int ownerOffset, RadDirection popupDirection)
The screen coordinates where the menu should be displayed.
ownerOffsetintThe offset from the owner element, in pixels.
popupDirectionRadDirectionThe direction in which the menu should open.