DropDownButton.DropDownControl Property
Gets or sets the popup control for the button.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v18.2.dll
Declaration
[DXCategory("Behavior")]
[DefaultValue(null)]
public virtual IDXDropDownControl DropDownControl { get; set; }
<DXCategory("Behavior")>
<DefaultValue(Nothing)>
Public Overridable Property DropDownControl As IDXDropDownControl
Property Value
Type | Default | Description |
---|---|---|
IDXDropDownControl | null |
A popup control object. |
Remarks
You can use the following objects for a popup control:
- PopupMenu - a popup menu managed by a BarManager or RibbonControl component.
- PopupControlContainer - a container for other controls. This control is also managed by a BarManager or RibbonControl component.
- DXPopupMenu - a popup menu.
NOTE
For the PopupMenu and PopupControlContainer objects to work correctly, ensure that they are associated with a BarManager or RibbonControl component. Use their Manager or Ribbon property to bind the objects to one of these components.
Before a popup control is displayed, the DropDownButton.ShowDropDownControl event is raised. Handle this event to dynamically customize the popup control, block it in specific cases, or supply a custom popup control dynamically.
The DropDownButton.ArrowButtonClick event allows you to display a custom popup control when the user clicks the drop-down arrow.
To open the popup control in code, call the DropDownButton.ShowDropDown method. The DropDownButton.HideDropDown method closes the popup control.
The code sample below illustrates how to add a drop-down menu to a drop-down button.
DXPopupMenu popupMenu = new DXPopupMenu();
popupMenu.Items.Add(new DXMenuItem() { Caption = "Menu Item" });
popupMenu.Items.Add(new DXMenuCheckItem() { Caption = "Check Item" });
dropDownButton1.DropDownControl = popupMenu;