dxDropDownButton
Namespace: Wisej.Web.Ext.DevExtreme
Assembly: Wisej.Web.Ext.DevExtreme (4.1.0.0)
The DropDownButton is a button that opens a drop-down menu with a list of actions or options.
- C#
- VB.NET
public class dxDropDownButton : dxBase
Public Class dxDropDownButton
Inherits dxBase
Constructors
dxDropDownButton()
Constructs a new instance of the dxDropDownButton class.
Example:
The following example creates a drop-down button and shows the menu item clicked by the user.
var button = new dxDropDownButton();
button.Options.text = "Export";
button.Options.icon = "export";
button.Options.items = new[] { "PDF", "Excel", "CSV" };
button.Instance.onItemClick += new WidgetEventHandler((s, e) =>
{
AlertBox.Show($"Export to {e.Data.itemData}");
});
button.Size = new Size(140, 36);
this.Controls.Add(button);
dxDropDownButton(options)
Constructs a new instance of the dxDropDownButton class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial set of options. |
Example:
The following example creates a split button that displays the item selected in its drop-down menu.
var button = new dxDropDownButton(new
{
items = new[]
{
new { id = 1, name = "Sort by name" },
new { id = 2, name = "Sort by date" }
},
keyExpr = "id",
displayExpr = "name",
selectedItemKey = 1,
useSelectMode = true,
splitButton = true
});
button.Size = new Size(180, 36);
this.Controls.Add(button);