ToolBar - Item Types

  • Button
  • Toggle button
  • Group:
  • Left
  • Center
  • Right
  • Drop down
    • Bold
    • Italic
    • Underline
  • Split button
    • Common action
    • Another common action
    • Action
  • Navigate!
  • Template:
    Pick Color(Current Color is blank)
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

RadToolBar provides three types of items - RadToolBarButton, RadToolBarDropDown and RadToolBarSplitButton

  • RadToolBarButton:
    • Can be templated, e.g. you can define an ItemTemplate for it
    • Can be set to act as a separator using the IsSeparator property
    • Can be set to directly navigate to a specified URL using the NavigateUrl property
    • Several buttons can be grouped group and checked/unchecked respectively. Use the CheckOnClick, Checked, Group and AllowSelfUnCheck properties to control the check functionality of a button.
    • When an event handler is attached to the toolbar's ButtonClick event, buttons make postback by default. Use the PostBack property of a button to disable the postback for it
  • RadToolBarDropDown can contain buttons in its dropdown
  • RadToolBarSplitButton:
    • Can contain buttons in its dropdown
    • Can be set to directly navigate to a specified URL using the NavigateUrl property
    • When an event handler is attached to the toolbar's ButtonClick event, clicking the button part of a split button initiates postback by default. Use the PostBack property of a split button to disable the postback for it
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="ToolBar.Examples.Functionality.RightToLeft.DefaultCS"Language="C#"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" type="text/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" ID="RadToolBar1" runat="server" EnableRoundedCorners="true" EnableShadows="true" Width="940px">
            <Items>
                <telerik:RadToolBarButton Text="Button">
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton IsSeparator="true">
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton Text="Toggle button" CheckOnClick="true" Checked="true"
                    AllowSelfUnCheck="true">
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton IsSeparator="true">
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton>
                    <ItemTemplate>
                        <span class="templateText">Group:</span>
                    </ItemTemplate>
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton ImageUrl="~/ToolBar/Examples/Functionality/ItemTypes/images/left.png"
                    Text="Left" Group="Align" CheckOnClick="true">
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton ImageUrl="~/ToolBar/Examples/Functionality/ItemTypes/images/center.png"
                    Text="Center" Group="Align" CheckOnClick="true" Checked="true">
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton ImageUrl="~/ToolBar/Examples/Functionality/ItemTypes/images/right.png"
                    Text="Right" Group="Align" CheckOnClick="true">
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton IsSeparator="true">
                </telerik:RadToolBarButton>
                <telerik:RadToolBarDropDown Text="Drop down">
                    <Buttons>
                        <telerik:RadToolBarButton Text="Bold" ImageUrl="~/ToolBar/Examples/Functionality/ItemTypes/images/bold.png"
                            Group="Bold" CheckOnClick="true" AllowSelfUnCheck="true">
                        </telerik:RadToolBarButton>
                        <telerik:RadToolBarButton Text="Italic" ImageUrl="~/ToolBar/Examples/Functionality/ItemTypes/images/italic.png"
                            Group="Italic" CheckOnClick="true" AllowSelfUnCheck="true">
                        </telerik:RadToolBarButton>
                        <telerik:RadToolBarButton Text="Underline" ImageUrl="~/ToolBar/Examples/Functionality/ItemTypes/images/underline.png"
                            Group="Underline" CheckOnClick="true" AllowSelfUnCheck="true">
                        </telerik:RadToolBarButton>
                    </Buttons>
                </telerik:RadToolBarDropDown>
                <telerik:RadToolBarButton IsSeparator="true">
                </telerik:RadToolBarButton>
                <telerik:RadToolBarSplitButton EnableDefaultButton="false" Text="Split button">
                    <Buttons>
                        <telerik:RadToolBarButton Text="Common action">
                        </telerik:RadToolBarButton>
                        <telerik:RadToolBarButton Text="Another common action">
                        </telerik:RadToolBarButton>
                        <telerik:RadToolBarButton IsSeparator="true">
                        </telerik:RadToolBarButton>
                        <telerik:RadToolBarButton Text="Action">
                        </telerik:RadToolBarButton>
                    </Buttons>
                </telerik:RadToolBarSplitButton>
                <telerik:RadToolBarButton IsSeparator="true">
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton Text="Navigate!" NavigateUrl="http://www.telerik.com/community"
                    Target="_blank">
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton IsSeparator="true">
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton>
                    <ItemTemplate>
                        <table style="display: block;">
                            <tr>
                                <td class="templateText">Template:
                                </td>
                                <td>
                                    <telerik:RadColorPicker RenderMode="Lightweight" runat="server" ID="RadColorPicker1" Preset="Standard" ShowIcon="true">
                                    </telerik:RadColorPicker>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:RadToolBarButton>
            </Items>
        </telerik:RadToolBar>
    </div>
    </form>
</body>
</html>

Find Assistance

Help Us Improve

Was this example helpful?