DropDownList - Keyboard Support


Demo Configurator

  • Command keyAlt
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

Keyboard Support

A critical requirement for software accessibility is keyboard support as a complete alternative to pointing devices (mouse, etc.).

Keyboard support is comprised of command key, focus key, and keyboard navigation. RadDropDownList will seamlessly switch between mouse and keyboard navigation.

In order to configure keyboard support with RadDropDownList its KeyboardNaviagationSettings should be set:

<telerik:RadDropDownList ID="RadDropDownList1" runat="server" >
    <KeyboardNavigationSettings CommandKey="Alt" FocusKey="M" />

The KeyboardNavigationSettings exposes two properties to configure the keyboard combination that sets focus to the control:

  • FocusKey: An upper-case letter or number.
  • CommandKey: Ctrl , Alt, Shift, or any combination of two of these keys.

When there are multiple DropDownList on a given page, each of them may have a different activation combination.

In this particular example, the [CommandKey] and the [FocusKey] can be customized in the Demo Configurator.

Once the RadDropDownList is focused (by pressing [CommandKey] + [FocusKey]):

  • PressAlt + DownArrow to expand the dropdown.
  • Press Alt + UpArrow or Esc to close the dropdown of the control.
  • Press DownArrow/UpArrow to navigate through the items.
  • Press Enter to select an Item.
  • Use PageUp or PageDown arrows to scroll to the previous/next portion of items in the drop down
  • Typing a letter moves focus to the next instance of a visible item, whose text begins with that letter.
  • Typing a sequence of letters moves focus to the first matched item, whose text starts with that sequence.
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="DropDownList.Examples.Accessibility.KeyboardSupport.DefaultCS" %>

<!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>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />

    <div class="demo-container size-thin">
        <telerik:RadDropDownList RenderMode="Lightweight" ID="RadDropDownList1" runat="server"
            Width="300px" DataSourceID="SqlDataSource1"
            DataTextField="ContactName" DefaultMessage="Select..."

    <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT [CustomerID], [ContactName] FROM [Customers] ORDER By ContactName"></asp:SqlDataSource>

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <telerik:AjaxSetting AjaxControlID="configurationpanel1">
                    <telerik:AjaxUpdatedControl ControlID="configurationpanel1" LoadingPanelID="radajaxloadingpanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadDropDownList1" />

    <telerik:RadAjaxLoadingPanel runat="server" ID="radajaxloadingpanel1" />

    <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1">
                <qsf:ConfiguratorColumn ID="ConfiguratorColumn1" runat="server" Size="Wide">

                    <ul class="fb-group">
                            <qsf:DropDownList runat="server" ID="DropDownListCommandKey"
                                Label="Command key" />
                            <qsf:MaskedTextBox runat="server" ID="RadMaskedTextBoxFocusKey"
                                Label="Focus key" />
                            <asp:CustomValidator ID="CustomValidator1" runat="server"
                                ForeColor="Red" Display="Dynamic"
                                Text="* Please type a valid uppercase lattin letter"
                                ClientValidationFunction="validateFocusKey" />
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            function validateFocusKey(source, arguments) {
                var maskedTextBox = $find("<%= RadMaskedTextBoxFocusKey.ClientID %>");
                var textBoxValue = maskedTextBox.get_textBoxValue().trim();

                if (textBoxValue.length != 1) {
                    arguments.IsValid = false;

                var keyCode = textBoxValue.charCodeAt(0);

                if (keyCode < 65 || keyCode > 90) {
                    arguments.IsValid = false;
                arguments.IsValid = true;

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?