SplitButton
Namespace: Wisej.Web.Ext.Syncfusion2
Assembly: Wisej.Web.Ext.Syncfusion2 (4.1.0.0)
SplitButton has primary and secondary button. Primary button is used to select default action and secondary button is used to toggle contextual overlays for displaying list of action items.
- C#
- VB.NET
public class SplitButton : ej2Base
Public Class SplitButton
Inherits ej2Base
Constructors
SplitButton()
Constructs a new instance of the SplitButton class.
Example:
The following example creates a split button and defines its items through the Options object.
var splitButton = new SplitButton();
splitButton.Options.content = "Paste";
splitButton.Options.items = new[]
{
new { text = "Paste as Text" },
new { text = "Paste Special" }
};
this.Controls.Add(splitButton);
SplitButton(options)
Constructs a new instance of the SplitButton class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial set of options. |
Example:
The following example creates a split button and handles both the click on the primary button and the selection of an item in the drop down list.
var splitButton = new SplitButton(new
{
content = "Save",
items = new[]
{
new { text = "Save As..." },
new { text = "Save All" }
}
});
splitButton.Instance.onClick += new WidgetEventHandler((s, e) => AlertBox.Show("Save"));
splitButton.Instance.onSelect += new WidgetEventHandler((s, e) =>
{
AlertBox.Show($"Selected {e.Data.item.text}");
});
this.Controls.Add(splitButton);