Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

ToolBar / Item Types


  • 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

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.ToolBar.Functionality.ItemTypes.DefaultCS" %>

    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag runat="server" ID="Headtag1" />
        
        <style type="text/css">
            .RadToolBarDropDown .rtbWrap { font-weight: normal; }
            .RadToolBarDropDown .rtbChecked .rtbWrap { font-weight: bold; }
            
            .rtbTemplate .templateText
            {
                font: bold 11px Verdana, sans-serif;
                font: bold 12px 'Segoe UI', 'Myriad Pro';
                font-style: italic;
                cursor: default;
                padding: 0 3px;
            }
            
            .rtbWrap[target] .rtbText { border-bottom: 1px solid #000; padding-bottom: 1px; }
        </style>
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
            <telerik:RadScriptManager ID="ScriptManager" runat="server" />
            <qsf:Header runat="server" ID="Header1" NavigationLanguage="C#" />
            

                <telerik:RadToolBar id="RadToolBar1" runat="server" EnableRoundedCorners="true" EnableShadows="true">
                    <Items>
                        <telerik:RadToolBarButton Text="Button" />
                        
                        <telerik:RadToolBarButton IsSeparator="true" />
                        
                        <telerik:RadToolBarButton Text="Toggle button" CheckOnClick="true" Checked="true" AllowSelfUncheck="true" />
                        
                        <telerik:RadToolBarButton IsSeparator="true" />
                        
                        <telerik:RadToolBarButton>
                            <ItemTemplate>
                                <span class="templateText">Group:</span>
                            </ItemTemplate>
                        </telerik:RadToolBarButton>
                            
                        <telerik:RadToolBarButton ImageUrl="~/ToolBar/Examples/Functionality/ItemTypes/Img/left.gif" Text="Left" Group="Align" CheckOnClick="true" />
                        <telerik:RadToolBarButton ImageUrl="~/ToolBar/Examples/Functionality/ItemTypes/Img/center.gif" Text="Center" Group="Align" CheckOnClick="true" Checked="true" />
                        <telerik:RadToolBarButton ImageUrl="~/ToolBar/Examples/Functionality/ItemTypes/Img/right.gif" Text="Right" Group="Align" CheckOnClick="true" />
                        
                        <telerik:RadToolBarButton IsSeparator="true" />
                        
                        <telerik:RadToolBarDropDown Text="Drop down">
                            <Buttons>
                                <telerik:RadToolBarButton Text="Bold" ImageUrl="~/ToolBar/Examples/Functionality/ItemTypes/Img/bold.gif" Group="Bold" CheckOnClick="true" AllowSelfUnCheck="true" />
                                <telerik:RadToolBarButton Text="Italic" ImageUrl="~/ToolBar/Examples/Functionality/ItemTypes/Img/italic.gif" Group="Italic" CheckOnClick="true" AllowSelfUnCheck="true" />
                                <telerik:RadToolBarButton Text="Underline" ImageUrl="~/ToolBar/Examples/Functionality/ItemTypes/Img/underline.gif" Group="Underline" CheckOnClick="true" AllowSelfUnCheck="true" />
                            </Buttons>
                        </telerik:RadToolBarDropDown>
                        
                        <telerik:RadToolBarButton IsSeparator="true" />
                        
                        <telerik:RadToolBarSplitButton EnableDefaultButton="false" Text="Split button">
                            <Buttons>
                                <telerik:RadToolBarButton Text="Common action" />
                                <telerik:RadToolBarButton Text="Another common action" />
                                <telerik:RadToolBarButton IsSeparator="true" />
                                <telerik:RadToolBarButton Text="Action" />
                            </Buttons>
                        </telerik:RadToolBarSplitButton>
                        
                        <telerik:RadToolBarButton IsSeparator="true" />
                        
                        <telerik:RadToolBarButton Text="Navigate!" NavigateUrl="http://www.telerik.com/clientNet" Target="_blank" />
                        
                        <telerik:RadToolBarButton IsSeparator="true" />
                        
                        <telerik:RadToolBarButton>
                            <ItemTemplate>
                                <table style="display:block;"><tr><td class="templateText">Template:</td><td><telerik:RadColorPicker runat="server" id="RadColorPicker1" Preset="Trek" ShowIcon="true" /></td></tr></table>
                            </ItemTemplate>
                        </telerik:RadToolBarButton>
                    </Items>
                </telerik:RadToolBar>
                
            <qsf:Footer runat="server" ID="Footer1" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451