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

RibbonBar / Client-side

The example now demonstrates four new events:

  • ApplicationMenuItemClicking
  • ApplicationMenuItemClicked
  • ClientSelectedTabChanging
  • ClientSelectedTabChanged

Logged events
Clear log Event log:

  • RadRibbonBar exposes the following client-side events:

    Load
    Raised when the client object of RadRibbonBar is created and initialized.
    ApplicationMenuItemClicking
    Raised when an application menu item is clicked. Can be cancelled.
    ApplicationMenuItemClicked
    Raised when an application menu item is clicked.
    SelectedTabChanging
    Raised when a non-selected tab is clicked. Can be cancelled.
    SelectedTabChanged
    Raised when a non-selected tab is clicked and successfully selected.
    ButtonClicking
    Raised when a Button is clicked. Can be cancelled.
    ButtonClicked
    Raised when a Button is clicked.
    SpiltButtonClicking
    Raised when a SplitButton item is clicked. Can be cancelled.
    SpiltButtonClicked
    Raised when a SplitButton item is clicked.
    ButtonToggling
    Raised when a ToggleButton is clicked. Can be cancelled.
    ButtonToggled
    Raised when a ToggleButton is clicked.
    MenuButtonClicking
    Raised when a menu Button is clicked. Can be cancelled.
    MenuButtonClicked
    Raised when a menu Button is clicked.
    LauncherClicking
    Raised when a group Launcher is clicked. Can be cancelled.
    LauncherClicked
    Raised when a group Launcher is clicked.
    ToggleListToggling
    Raised when a ToggleButton inside ToggleList is toggled. The event can be canceled (TogglED).
    ToggleListToggled
    Raised when a ToggleButton inside ToggleList is toggled.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="VB" AutoEventWireup="true" CodeFile="DefaultVB.aspx.vb" Inherits="DefaultVB" %>

    <%@ 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.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag runat="server" ID="Headtag1"></qsf:HeadTag>
        <link rel="stylesheet" href="styles.css" type="text/css" />
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
        <telerik:RadScriptManager ID="ScriptManager" runat="server" />
        <qsf:Header runat="server" ID="Header1" NavigationLanguage="VB"></qsf:Header>
        <qsf:InformationBox ID="InformationBox1" runat="server"
            Title="The example now demonstrates four new events: <ul><li><strong>ApplicationMenuItemClicking</strong></li><li><strong>ApplicationMenuItemClicked</strong></li><li><strong>ClientSelectedTabChanging</strong></li><li><strong>ClientSelectedTabChanged</strong></li></ul>">
        </qsf:InformationBox>
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
            <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Title="Logged events">
                <ul style="margin-left: 0; border-left: none; width: 225px">
                    <li>
    <asp:CheckBox ID="LoadCheckBox" runat="server" Text="OnClientLoad" AutoPostBack="True"
    Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="ApplicationMenuItemClickingCheckBox" runat="server" Text="OnClientApplicationMenuItemClicking"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="ApplicationMenuItemClickedCheckBox" runat="server" Text="OnClientApplicationMenuItemClicked"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="SelectedTabChangingCheckBox" runat="server" Text="OnClientSelectedTabChanging"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="SelectedTabChangedCheckBox" runat="server" Text="OnClientSelectedTabChanged"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="ButtonClickingCheckBox" runat="server" Text="OnClientButtonClicking"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="ButtonClickedCheckBox" runat="server" Text="OnClientButtonClicked"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="SplitButtonClickingCheckBox" runat="server" Text="OnClientSplitButtonClicking"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="SplitButtonClickedCheckBox" runat="server" Text="OnClientSplitButtonClicked"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="ToggleButtonTogglingCheckBox" runat="server" Text="OnClientButtonToggling"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="ToggleButtonToggledCheckBox" runat="server" Text="OnClientButtonToggled"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="MenuItemClickingCheckBox" runat="server" Text="OnClientMenuItemClicking"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="MenuItemClickedCheckBox" runat="server" Text="OnClientMenuItemClicked"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="LauncherClickingCheckBox" runat="server" Text="OnClientLauncherClicking"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="LauncherClickedCheckBox" runat="server" Text="OnClientLauncherClicked"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="ToggleListTogglingCheckBox" runat="server" Text="OnClientToggleListToggling"
    AutoPostBack="True" Checked="True" />

                    </li>
                    <li>
    <asp:CheckBox ID="ToggleListToggledCheckBox" runat="server" Text="OnClientToggleListToggled"
    AutoPostBack="True" Checked="True" />

                    </li>
                </ul>
            </qsf:ConfiguratorPanel>
            <telerik:RibbonBarApplicationMenu ID="RadRibbonBarApplicationMenu1" runat="server" Text="File">
                <Items>
                    <telerik:RibbonBarApplicationMenuItem Text="New" ImageUrl="icons/file/New.gif" />
                    <telerik:RibbonBarApplicationMenuItem Text="Open" ImageUrl="icons/file/Open.gif" />
                    <telerik:RibbonBarApplicationMenuItem Text="Save" ImageUrl="icons/file/Save.gif" />
                    <telerik:RibbonBarApplicationMenuItem Text="Save As" ImageUrl="icons/file/SaveAs.gif" />
                    <telerik:RibbonBarApplicationMenuItem Text="Close" ImageUrl="icons/file/Close.gif" />
                </Items>
            </telerik:RibbonBarApplicationMenu>
            <telerik:RadRibbonBar ID="RadRibbonBar1" runat="server" ApplicationMenuID="RadRibbonBarApplicationMenu1"
                OnClientLoad="onLoad" OnClientApplicationMenuItemClicking="onApplicationMenuItemClicking"
                OnClientApplicationMenuItemClicked="onApplicationMenuItemClicked" OnClientSelectedTabChanging="onSelectedTabChanging"
                OnClientSelectedTabChanged="onSelectedTabChanged" OnClientButtonClicking="onButtonClicking"
                OnClientButtonClicked="onButtonClicked" OnClientSplitButtonClicking="onMenuButtonClicking"
                OnClientButtonToggling="onButtonToggling" OnClientButtonToggled="onButtonToggled"
                OnClientSplitButtonClicked="onMenuButtonClicked" OnClientMenuItemClicking="onMenuItemClicking"
                OnClientMenuItemClicked="onMenuItemClicked" OnClientLauncherClicking="onLauncherClicking"
                OnClientLauncherClicked="onLauncherClicked" OnClientToggleListToggling="onToggleListToggling"
                OnClientToggleListToggled="onToggleListToggled">
                <telerik:RibbonBarTab Text="Home">
                    <telerik:RibbonBarGroup Text="Clipboard" EnableLauncher="true">
                        <Items>
                            <telerik:RibbonBarMenu Size="Large" Text="Paste" ImageUrl="icons/home/Paste.png">
                                <Items>
                                    <telerik:RibbonBarMenuItem Text="Paste" ImageUrl="icons/home/Paste.png" />
                                    <telerik:RibbonBarMenuItem Text="Paste Special..." ImageUrl="icons/home/Paste.png" />
                                </Items>
                            </telerik:RibbonBarMenu>
                            <telerik:RibbonBarButton Size="Medium" Text="Cut" ImageUrl="icons/home/Cut.png" />
                            <telerik:RibbonBarButton Size="Medium" Text="Copy" ImageUrl="icons/home/Copy.png" />
                            <telerik:RibbonBarButton Size="Medium" Text="Format" ImageUrl="icons/home/Format_Painter.png" />
                        </Items>
                    </telerik:RibbonBarGroup>
                    <telerik:RibbonBarGroup Text="Font">
                        <Items>
                            <telerik:RibbonBarToggleButton Size="Small" Text="Bold" ImageUrl="icons/home/font/Bold.png" />
                            <telerik:RibbonBarToggleButton Size="Small" Text="Italic" ImageUrl="icons/home/font/Italic.png" />
                            <telerik:RibbonBarToggleButton Size="Small" Text="Underline" ImageUrl="icons/home/font/Underline.png" />
                            <telerik:RibbonBarToggleButton Size="Small" Text="Strikethrough" ImageUrl="icons/home/font/Strike.png" />
                            <telerik:RibbonBarToggleList>
                                <ToggleButtons>
                                    <telerik:RibbonBarToggleButton Size="Small" Text="Superscript" ImageUrl="icons/home/font/Superscript.png" />
                                    <telerik:RibbonBarToggleButton Size="Small" Text="Subscript" ImageUrl="icons/home/font/Subscript.png" />
                                </ToggleButtons>
                            </telerik:RibbonBarToggleList>
                        </Items>
                    </telerik:RibbonBarGroup>
                    <telerik:RibbonBarGroup Text="Paragraph">
                        <Items>
                            <telerik:RibbonBarButtonStrip>
                                <Buttons>
                                    <telerik:RibbonBarButton Text="Align Left" ImageUrl="icons/home/paragraph/AlignLeft.png" />
                                    <telerik:RibbonBarButton Text="Align Center" ImageUrl="icons/home/paragraph/AlignCenter.png" />
                                    <telerik:RibbonBarButton Text="Align Right" ImageUrl="icons/home/paragraph/AlignRight.png" />
                                    <telerik:RibbonBarButton Text="Justify" ImageUrl="icons/home/paragraph/Justify.png" />
                                </Buttons>
                            </telerik:RibbonBarButtonStrip>
                            <telerik:RibbonBarButtonStrip>
                                <Buttons>
                                    <telerik:RibbonBarButton Size="Small" Text="Unordered List" ImageUrl="icons/home/paragraph/UL.png" />
                                    <telerik:RibbonBarButton Size="Small" Text="Numbered List" ImageUrl="icons/home/paragraph/OL.png" />
                                </Buttons>
                            </telerik:RibbonBarButtonStrip>
                            <telerik:RibbonBarButtonStrip>
                                <Buttons>
                                    <telerik:RibbonBarButton Size="Small" Text="Decrease Indent" ImageUrl="icons/home/paragraph/DecrIndent.png" />
                                    <telerik:RibbonBarButton Size="Small" Text="Increase Indent" ImageUrl="icons/home/paragraph/IncrIndent.png" />
                                </Buttons>
                            </telerik:RibbonBarButtonStrip>
                        </Items>
                    </telerik:RibbonBarGroup>
                    <telerik:RibbonBarGroup Text="Editing" EnableLauncher="true">
                        <Items>
                            <telerik:RibbonBarSplitButton Size="Medium" Text="Find" ImageUrl="icons/home/Find.png">
                                <Buttons>
                                    <telerik:RibbonBarButton Text="Find..." ImageUrl="icons/home/Find.png" />
                                    <telerik:RibbonBarButton Text="Go to..." ImageUrl="icons/home/Go.png" />
                                </Buttons>
                            </telerik:RibbonBarSplitButton>
                            <telerik:RibbonBarButton Size="Medium" Text="Replace" ImageUrl="icons/home/Replace.png" />
                            <telerik:RibbonBarMenu Size="Medium" Text="Select" ImageUrl="icons/home/Select.png">
                                <Items>
                                    <telerik:RibbonBarMenuItem Text="Select All" ImageUrl="icons/home/Select_All.png" />
                                    <telerik:RibbonBarMenuItem Text="Select Objects" ImageUrl="icons/home/Select.png" />
                                </Items>
                            </telerik:RibbonBarMenu>
                        </Items>
                    </telerik:RibbonBarGroup>
                </telerik:RibbonBarTab>
                <telerik:RibbonBarTab Text="Insert">
                    <telerik:RibbonBarGroup Text="Illustrations">
                        <Items>
                            <telerik:RibbonBarButton Size="Large" Text="Picture" ImageUrl="icons/insert/Picture.png" />
                            <telerik:RibbonBarButton Size="Large" Text="Clip Art" ImageUrl="icons/insert/Clipart.png" />
                            <telerik:RibbonBarMenu Size="Large" Text="Shapes" ImageUrl="icons/insert/Shapes.png" />
                            <telerik:RibbonBarButton Size="Large" Text="SmartArt" ImageUrl="icons/insert/SmartArt.png" />
                            <telerik:RibbonBarButton Size="Large" Text="Chart" ImageUrl="icons/insert/Chart.png" />
                        </Items>
                    </telerik:RibbonBarGroup>
                    <telerik:RibbonBarGroup Text="Links">
                        <Items>
                            <telerik:RibbonBarButton Size="Large" Text="Hyperlink" ImageUrl="icons/insert/Link.png" />
                            <telerik:RibbonBarButton Size="Large" Text="Bookmark" ImageUrl="icons/insert/Bookmark.png" />
                            <telerik:RibbonBarButton Size="Large" Text="Cross-reference" ImageUrl="icons/insert/Cross_reference.png" />
                        </Items>
                    </telerik:RibbonBarGroup>
                </telerik:RibbonBarTab>
                <telerik:RibbonBarTab Text="View">
                    <telerik:RibbonBarGroup Text="Zoom">
                        <Items>
                            <telerik:RibbonBarToggleList>
                                <ToggleButtons>
                                    <telerik:RibbonBarToggleButton Size="Large" Text="Zoom" ImageUrl="icons/view/Zoom.png" />
                                    <telerik:RibbonBarToggleButton Size="Large" Text="100%" ImageUrl="icons/view/100.png" />
                                </ToggleButtons>
                            </telerik:RibbonBarToggleList>
                            <telerik:RibbonBarToggleList>
                                <ToggleButtons>
                                    <telerik:RibbonBarToggleButton Size="Medium" Text="One Page" ImageUrl="icons/view/One_Page.png" />
                                    <telerik:RibbonBarToggleButton Size="Medium" Text="Two Pages" ImageUrl="icons/view/Two_Pages.png" />
                                    <telerik:RibbonBarToggleButton Size="Medium" Text="Page Width" ImageUrl="icons/view/Page_Width.png" />
                                </ToggleButtons>
                            </telerik:RibbonBarToggleList>
                        </Items>
                    </telerik:RibbonBarGroup>
                    <telerik:RibbonBarGroup Text="Macros">
                        <Items>
                            <telerik:RibbonBarSplitButton Size="Large" Text="Macros" ImageUrl="icons/view/Macros.png">
                                <Buttons>
                                    <telerik:RibbonBarButton Text="View Macros" ImageUrl="icons/view/Macros.png" />
                                    <telerik:RibbonBarButton Text="Record Macro..." ImageUrl="icons/view/Macros_Record.png" />
                                </Buttons>
                            </telerik:RibbonBarSplitButton>
                        </Items>
                    </telerik:RibbonBarGroup>
                </telerik:RibbonBarTab>
            </telerik:RadRibbonBar>
        </telerik:RadAjaxPanel>
        <script type="text/javascript">
            function onLoad(sender, args) {
                logEvent("Load: " + sender.get_id());
            }

            function onApplicationMenuItemClicking(sender, eventArgs) {
                logEvent("ApplicationMenuItemClicking: " + eventArgs.get_item().get_text());
            }

            function onApplicationMenuItemClicked(sender, eventArgs) {
                logEvent("ApplicationMenuItemClicked: " + eventArgs.get_item().get_text());
            }

            function onSelectedTabChanging(sender, args) {
                logEvent("SelectedTabChanging: Previously selected was '" + args.get_previouslySelectedTab().get_text() + "', now about to be selected is '" + args.get_tab().get_text() + "'");
            }

            function onSelectedTabChanged(sender, args) {
                logEvent("SelectedTabChanged: Selected is '" + args.get_tab().get_text() + "'");
            }

            function onButtonClicking(sender, args) {
                logEvent("ButtonClicking: " + args.get_button().get_text());
            }

            function onButtonClicked(sender, args) {
                logEvent("ButtonClicked: " + args.get_button().get_text());
            }

            function onSplitButtonClicking(sender, args) {
                logEvent("SplitButtonClicking: " + args.get_button().get_text());
            }

            function onSplitButtonClicked(sender, args) {
                logEvent("SplitButtonClicked: " + args.get_button().get_text());
            }

            function onButtonToggling(sender, args) {
                logEvent("ToggleButtonToggling: " + args.get_button().get_text());
            }

            function onButtonToggled(sender, args) {
                logEvent("ToggleButtonToggled: " + args.get_button().get_text());
            }

            function onMenuItemClicking(sender, args) {
                logEvent("MenuItemClicking: " + args.get_item().get_text());
            }

            function onMenuItemClicked(sender, args) {
                logEvent("MenuItemClicked: " + args.get_item().get_text());
            }

            function onLauncherClicking(sender, args) {
                logEvent("LauncherClicking: " + args.get_group().get_text());
            }

            function onLauncherClicked(sender, args) {
                logEvent("LauncherClicked: " + args.get_group().get_text());
            }

            function onToggleListToggling(sender, args) {
                logEvent("ToggleListToggling: " + args.get_button().get_text());
            }

            function onToggleListToggled(sender, args) {
                logEvent("ToggleListToggled: " + args.get_button().get_text());
            }
        </script>
        <qsf:EventLogConsole ID="EventLogConsole1" runat="server" AllowClear="true" />
        <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