RadToolBar for ASP.NET

Defining the Structure Programmatically Send comments on this topic.
Defining the ToolBars Structure > Defining the Structure Programmatically

Glossary Item Box

The structure of the toolbar can be defined from the codebehind. Telerik RadToolBar provides a rich and easy-to-use server-side API, so you can easily populate your toolbar with any number and/or type of items. 

Example:

Programmatically defined 

C# Copy Code
public class DefaultCS : System.Web.UI.Page
   {
       
protected RadToolBar toolbar1;
       
private void Page_Load(object sender, System.EventArgs e)
       {
           RadToolBarButton button_new =
new RadToolBarButton();
           button_new.CommandName =
"new";
           button_new.ButtonImage =
"new.gif";
           button_new.ToolTip =
"New Document";

           RadToolBarSeparator separator1 =
new RadToolBarSeparator();

           RadToolBarToggleButton toggle1 =
new RadToolBarToggleButton();
           toggle1.CommandName =
"toggle";
           toggle1.Toggled = true;
           toggle1.DisplayType = RadToolBarButton.ButtonDisplayType.TextOnly;
           toggle1.ButtonText =
"toggle button";
           toggle1.Width = Unit.Pixel(100);

           toolbar1.Items.Add(button_new);
           toolbar1.Items.Add(separator1);
           toolbar1.Items.Add(toggle1);
       }