New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Server-side Programming Overview

You can configure the settings of RadSplitButton and create its items in the code-behind via the Server-Side API of the control.

RadSplitButton Public Properties and Methods

For a list with the server-side properties and methods of the control, see the Server-Side API of the RadSplitButton class. You can also find it in the IntelliSense in Visual Studio.

Information about the Server-side APIs of the embedded ContextMenu you can find in the dedicated articles:

RadSplitButton Server-side Events

PropertyDescription
OnClickraised when the RadSplitButton or one of its ContextMenu Items is clicked. (AutoPostBack=true)
OnCommandraised on Postback triggered by the SplitButton. The CommandArgument and CommandName are passed as event arguments.

Create a RadSplitButton in the Code-behind

ASP.NET
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
C#
protected void Page_Init(object sender, EventArgs e)
{
    var splitButton = new RadSplitButton();
    splitButton.ID = "RadSplitButton1";
    splitButton.Skin = "Silk";
    splitButton.Text = "SplitButton";
    splitButton.CommandArgument = "CustomCommandArgument";
    splitButton.CommandName = "Command1";

    var menuItem = new RadMenuItem("SplitButton");
    menuItem.Value = "Command1";
    splitButton.ContextMenu.Items.Add(menuItem);
    menuItem = new RadMenuItem("Action2");
    menuItem.Value = "Command2";
    splitButton.ContextMenu.Items.Add(menuItem);
    menuItem = new RadMenuItem("Action3");
    menuItem.Value = "Command3";
    splitButton.ContextMenu.Items.Add(menuItem);

    PlaceHolder1.Controls.Add(splitButton);
}

See Also