New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Dynamic Creation

  • Bold
  • Italic
  • Underline
  • Align
    • Left
    • Center
    • Right
    • Justify
  • Red
    • Red
    • Blue
    • Green
  • Refresh page...

You can dynamically add items to a toolbar instance using the server-side API. The RadToolBar class exposes an Items collection. The RadToolBarDropDown and RadToolBarSplitButton classes have Buttons collections. Buttons added to the Buttons collection of a particular dropdown item are the child buttons of that item.

This example demonstrates the server-side population of a RadToolBar

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="ToolBar.Examples.PopulatingWithData.DynamicCreation.DefaultCS"Language="c#"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container">
        <telerik:RadToolBar RenderMode="Lightweight" runat="server" ID="RadToolBar1" EnableRoundedCorners="true" EnableShadows="true">
        </telerik:RadToolBar>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance