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

Button / Keyboard Support

Press "Alt + AccessKey in IE" ("Shift + Alt + AccessKey" for Firefox, Shift + Esc + AccessKey for Opera) or use Tab to move to and focus the Button control.
Note: By default tab-access is disabled in Safari. To enable it, check "Preferences > Advanced > Press tab to highlight each item on a page".
This is a standard button with "AccessKey: A".
Link Button This is a Link button with "AccessKey: B".
Radio Button 1
Radio Button 2
Radio Button 3
Radio buttons with AccessKey attributes: 1, 2 and 3, respectively.
CheckBox 1
CheckBox 2
CheckBox 3
Checkbox buttons with AccessKey attributes: 4, 5 and 6, respectively.
These RadButton checkbox buttons have AccessKey attributes: 7, 8 and 9.
This CustomToggle button has assigned "AccessKey: 0 (number)".

  • Keyboard Support

    This example demonstrates how you can use the keyboard to control RadButton. You can focus a button by using the Tab key if you set the TabIndex property of RadButton. In addition, you can use a shortcut if you set the AccessKey property. To execute a selected Link button press the Enter key.

Source Code

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

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ 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" %>
    <!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></title>
        <qsf:HeadTag ID="Headtag1" runat="server" />
        <style type="text/css">
            .yesNoHovered .rbText
            {
                color: White !important;
            }
            .imgBtnTable td
            {
                border-bottom: 1px solid #eee;
                padding: 5px;
            }
            .imgBtnTable td.center
            {
                padding-left: 50px;
                border-right: 1px solid #eee;
                width: 200px;
            }
        </style>
    </head>
    <body class="BODY">
        <form id="form1" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" ShowSkinChooser="false" />
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
         <qsf:InformationBox ID="InformationBox1" runat="server">
            Press "<strong>Alt + AccessKey in IE</strong>" ("<strong>Shift + Alt + AccessKey</strong>"
                    for Firefox, <strong>Shift + Esc + AccessKey</strong> for Opera) or use <strong>Tab</strong> to move to and focus the Button control.
            <br />
            <i>Note: By default tab-access is disabled in Safari. To enable it, check "Preferences
                > Advanced > Press tab to highlight each item on a page". </i>
        </qsf:InformationBox>
        <telerik:RadWindowManager EnableAriaSupport="true" ID="RadWindowManager" runat="server"></telerik:RadWindowManager>
        <div>
        <script type="text/javascript">
            /*Things to do after the Beta release:
            1. Get the value of the AccessKey from the button with AccessKey="A"
            2. Get the text from last button with AccessKey="0"
            */
            function OnClientClicked(sender, args) {
                var accessKey = ($telerik.isIE || sender.get_buttonType() == Telerik.Web.UI.RadButtonType.StandardButton) ? sender.get_textElement().accessKey : sender.get_element().accessKey;
                radalert(sender.get_text() + " with AccessKey " + accessKey + " button was pressed");
                //args.set_cancel(true);
            }
        </script>

            <table cellpadding="0" cellspacing="0" width="100%" class="imgBtnTable">
                <tr>
                    <td class="center">
                        <telerik:RadButton AccessKey="A" OnClientClicked="OnClientClicked" ID="btnUpload" AutoPostBack="false"
                            runat="server" ButtonType="StandardButton" Text="Standard Button">
                            <Icon PrimaryIconCssClass="rbUpload" PrimaryIconLeft="5" />
                        </telerik:RadButton>
                    </td>
                    <td >
                        This is a standard button with "AccessKey: A".
                    </td>
                </tr>
                <tr>
                    <td class="center">
                        <telerik:RadButton ID="RadButton1" AccessKey="B" AutoPostBack="false"
                        OnClientClicked="OnClientClicked" runat="server" ButtonType="LinkButton" Text="Link Button" ToolTip="Link Button">
                            <Icon SecondaryIconCssClass="rbSave" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        This is a Link button with "AccessKey: B".
                    </td>
                </tr>
                <tr>
                    <td class="center">
                        <telerik:RadButton ID="RadioButton1" AccessKey="1" OnClientClicked="OnClientClicked" runat="server" ButtonType="ToggleButton" ToggleType="Radio"
                            AutoPostBack="false" GroupName="Radio" Text="Radio Button 1" ToolTip="Radio Button 1">
                        </telerik:RadButton><br />
                        <telerik:RadButton ID="RadioButton2" AccessKey="2" OnClientClicked="OnClientClicked" runat="server" ButtonType="ToggleButton" ToggleType="Radio"
                            AutoPostBack="false" GroupName="Radio" Text="Radio Button 2" Checked="true" ToolTip="Radio Button 2">
                        </telerik:RadButton><br />
                        <telerik:RadButton ID="RadioButton3" AccessKey="3" OnClientClicked="OnClientClicked" runat="server" ButtonType="ToggleButton" ToggleType="Radio"
                            AutoPostBack="false" GroupName="Radio" Text="Radio Button 3" ToolTip="Radio Button 3">
                        </telerik:RadButton>
                    </td>
                    <td>
                        Radio buttons with AccessKey attributes: 1, 2 and 3, respectively.
                    </td>
                </tr>
                <tr>
                    <td class="center">
                        <telerik:RadButton ID="RadButton2" AccessKey="4" OnClientClicked="OnClientClicked" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox"
                            AutoPostBack="false" Text="CheckBox 1" ToolTip="CheckBox 1">
                        </telerik:RadButton><br />
                        <telerik:RadButton ID="RadButton3" AccessKey="5" OnClientClicked="OnClientClicked" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox"
                            AutoPostBack="false" Text="CheckBox 2" Checked="true" ToolTip="CheckBox 2">
                        </telerik:RadButton><br />
                        <telerik:RadButton ID="RadButton4" AccessKey="6" OnClientClicked="OnClientClicked" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox"
                            AutoPostBack="false" Text="CheckBox 3" ToolTip="CheckBox 3">
                        </telerik:RadButton>
                    </td>
                    <td>
                        Checkbox buttons with AccessKey attributes: 4, 5 and 6, respectively.
                    </td>
                </tr>
                <tr>
                    <td class="center">
                        <telerik:RadButton ID="CheckBox1" AccessKey="7" OnClientClicked="OnClientClicked" runat="server" ButtonType="StandardButton" ToggleType="CheckBox"
                            Checked="true" AutoPostBack="false" BorderWidth="0" BackColor="transparent" Text="CheckBox 1">
                            <ToggleStates>
                                <telerik:RadButtonToggleState Text="Checked" SecondaryIconCssClass="rbToggleCheckboxChecked" />
                                <telerik:RadButtonToggleState Text="UnChecked" SecondaryIconCssClass="rbToggleCheckbox" />
                            </ToggleStates>
                        </telerik:RadButton>
                        <div style="padding-bottom: 5px;">
                        </div>
                        <telerik:RadButton ID="CheckBox" AccessKey="8" OnClientClicked="OnClientClicked" runat="server" ButtonType="StandardButton" ToggleType="CheckBox"
                            AutoPostBack="false" BorderWidth="0" BackColor="transparent" Text="CheckBox 2">
                            <ToggleStates>
                                <telerik:RadButtonToggleState Text="Checked" SecondaryIconCssClass="rbToggleCheckboxChecked" />
                                <telerik:RadButtonToggleState Text="UnChecked" SecondaryIconCssClass="rbToggleCheckbox" />
                            </ToggleStates>
                        </telerik:RadButton>
                        <div style="padding-bottom: 5px;">
                        </div>
                        <telerik:RadButton ID="CheckBox3" AccessKey="9" OnClientClicked="OnClientClicked" runat="server" ButtonType="StandardButton" ToggleType="CheckBox"
                            Checked="true" AutoPostBack="false" BorderWidth="0" BackColor="transparent" Text="CheckBox 3">
                            <ToggleStates>
                                <telerik:RadButtonToggleState Text="Checked" SecondaryIconCssClass="rbToggleCheckboxChecked" />
                                <telerik:RadButtonToggleState Text="UnChecked" SecondaryIconCssClass="rbToggleCheckbox" />
                            </ToggleStates>
                        </telerik:RadButton>
                    </td>
                    <td>
                        These RadButton checkbox buttons have AccessKey attributes: 7, 8 and 9.
                    </td>
                </tr>
                <tr>
                    <td class="center">
                        <telerik:RadButton ID="BuiltinIconsButton2" AccessKey="0" OnClientClicked="OnClientClicked" runat="server" ButtonType="StandardButton" Text="Toggle Button"
                            ToggleType="CustomToggle" AutoPostBack="false">
                            <ToggleStates>
                                <telerik:RadButtonToggleState SecondaryIconCssClass="rbOk" Text="OK" />
                                <telerik:RadButtonToggleState SecondaryIconCssClass="rbCancel" Text="Cancel" />
                            </ToggleStates>
                        </telerik:RadButton>
                    </td>
                    <td>
                        This CustomToggle button has assigned "AccessKey: 0 (number)".
                    </td>
                </tr>
            </table>
        </div>
        <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