The RadWindow supports now keyboard shortcuts for its commands. Shortcuts can be used as an accessibility feature, or to make the work of the user more convenient. Shortcuts can be used to switch between active windows, to maximize or close the current active window, and other tasks.
This test demo has the following shortcuts specififed for demonstration purposes:
RadWindow with NavigateUrl="http://www.w3.org/":
-
Ctrl + F2 Maximize Window
-
Ctrl + F3 Restore Window
Shortcuts can be specified in the markup as shown in the demo or on the srever e.g as shown below:
RadWindow1.Shortcuts.Add(
"Close"
,
"Esc"
);
or
RadWindow1.Shortcuts.Add(
new
Telerik.Web.UI.WindowShortcut(
"Close"
,
"Esc"
);
Since Q2 2012 shortcuts can be manipulated dynamically via JavaScript as well. The main methods are:
-
addShortcut() - takes two strings - the command and the shortcut to add it for the RadWindow
-
removeAllShortcutsCommand() - removes shortcuts for the command that is passed as a string parameter
The command names are not case-sensitive and if such a command exists, it will be fired for the currently active RadWindow or for all windows in a manager if this the case.
This RadWindow demo shows how to add keyboard support for Telerik's ASP.NET PopUp Window component. Note, that the shortcut command is fired for a RadWindow only when the RadWindow is active. Commands, related to all windows in a RadWindowManager such as Tile, operate with all the windows which belong to the manager.
NEW - since Q2 2012 shortcuts for a RadWindow can be modified via JavaScript.
In the demo configurator RadWindow's shortcuts can be chosen via the dropdowns and buttons. The full list of commands is available in the related help article and the available key combinations are chosen for the sake of simplicity and are not limited to the ones in the dropdown.