Skip to main content

SettingsBase.AccessKey Property

Gets or sets the access key that allows you to quickly navigate to the ASP.NET MVC extension.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public string AccessKey { get; set; }

Property Value

Type Description
String

The access key for quick navigation to the ASP.NET MVC extension.

Property Paths

You can access this nested property as listed below:

Object Type Path to AccessKey
MVCxFormLayoutItem

Remarks

Use the AccessKey property to specify the keyboard shortcut for an extension. This allows end-users to navigate quickly to the extension by pressing the ALT key and the key for the specified character on the keyboard. For instance, setting the access key of an extension to the string “D“ indicates that an end-user can navigate to the extension by pressing ALT+D.

Only a single character string is allowed for the AccessKey property. If you attempt to set this property to a value that is neither null, Empty, nor a single character string, an exception is thrown.

The following code illustrates how to set and use the AccessKey property of a DevExpress ASP.NET MVC TextBox extension.

@Html.DevExpress().TextBox(
                settings => {
                    settings.Name = "TextBox1";
                    settings.Text = "Press Alt-Z to move focus here";
                    settings.AccessKey = "Z";
                }
            ).GetHtml()


            @Html.DevExpress().TextBox(
                settings => {
                    settings.Name = "TextBox2";
                    settings.Text = "Press Alt-X to move focus here";
                    settings.AccessKey = "X";
                }
            ).GetHtml() 
See Also