RadControls for ASP.NET AJAX RadWindow supports keyboard shortcuts to invoke its commands. This is an accessibility feature as well as functionality
that can make working with the application more convenient for the end user.
Shortcuts can be global for the RadWindowManager - for commands that affect all its child RadWindows
such as Tile, RestoreAll, CloseAll.
Commands that are specific for each separate RadWindow such as Close, Minimize, Maximize
must be declared for each separate RadWindow. They are only active if the RadWindow has focus.
There are three ways to specify these shortcuts. The more commong two are: in the <Shortcuts> inner tag:
CopyASPX
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Shortcuts>
<telerik:WindowShortcut CommandName="RestoreAll" Shortcut="Alt+F3" />
<telerik:WindowShortcut CommandName="Tile" Shortcut="Alt+F6" />
<telerik:WindowShortcut CommandName="CloseAll" Shortcut="Esc" />
</Shortcuts>
<Windows>
<telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true"
NavigateUrl="http://www.telerik.com">
<Shortcuts>
<telerik:WindowShortcut CommandName="Maximize" Shortcut="Ctrl+F2" />
<telerik:WindowShortcut CommandName="Restore" Shortcut="Ctrl+F3" />
</Shortcuts>
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
or via the Shortcuts server-side property:
CopyC#
RadWindow1.Shortcuts.Add("Close", "Esc");
RadWindow1.Shortcuts.Add(new Telerik.Web.UI.WindowShortcut("Close", "Esc"));
CopyVB
RadWindow1.Shortcuts.Add("Close", "Esc")
RadWindow1.Shortcuts.Add(new Telerik.Web.UI.WindowShortcut("Close", "Esc"))
Since Q2 2012 the RadWindow also offers the option to modify the shortcuts via JavaScript by using the following methods:
CopyJavaScript
var oWnd = $find("RadWindow1");
oWnd.addShortcut("Command", "shortcutString");
oWnd.removeShortcut("Command");
oWnd.getShortcutString("Command");
oWnd.isShortcutAdded("Command");
oWnd.removeAllShortcutsCommand("Command");
Note |
|---|
Shortcut modifications done via JavaScript will not be persisted if the control is disposed - either in an AJAX request,
a full postback or via the DestroyOnClose functionality. These modifications are available only for a
RadWindow instances and not for the RadWindowManager.
|
Tip |
|---|
You should avoid globally used combinations such as Alt+F4, Ctrl+F5, etc. that have meaning in the context of the user browser/machine.
|
Here follows a list with the available commands:
for the RadWindowManager
Name
|
Executed command
|
|---|
CloseAll |
Closes all opened RadWindows from the Windows Collection of the specific RadWindowManager
|
MinimizeAll |
Minimizes all opened RadWindows from the Windows Collection of the specific RadWindowManager
|
RestoreAll |
Restores all opened RadWindows from the Windows Collection of the specific RadWindowManager
|
MaximizeAll |
Maximizes all opened RadWindows from the Windows Collection of the specific RadWindowManager
|
MinimizeActiveWindow |
Minimizes the currently active (focused) RadWindow from the Windows Collection of the specific RadWindowManager
|
RestoreActiveWindow |
Restores the currently active (focused) RadWindow from the Windows Collection of the specific RadWindowManager
|
CloseActiveWindow |
Closes the currently active (focused) RadWindow from the Windows Collection of the specific RadWindowManager
|
For each separate RadWindow
Name | Executed command |
|---|
Minimize |
Minimizes the RadWindow
|
togglePin |
Changes the Pinned property of the RadWindow to the opposite value (true/false)
|
Close |
Closes the RadWindow
|
Maximize |
Maximizes the RadWindow
|
Reload |
Reloads the RadWindow
|
See Also