Keyboard Support
Keyboard support is comprised of command key, focus key, and keyboard navigation.
RadListBox will seamlessly switch between mouse and keyboard navigation.
In order to configure keyboard support with RadListBox its KeyboardNaviagationSettings should be set:
RadListBox fully supports keybord navigation: selecting, deleting, moving and reordering items.
Focus
<telerik:RadListBox ID="RadListBox1" runat="server" >
<KeyboardNavigationSettings CommandKey="Alt" FocusKey="A" />
<Items>
<telerik:RadListBoxItem Text="Amsterdam" >
</telerik:RadListBoxItem>
<telerik:RadListBoxItem Text="Barcelona" >
</telerik:RadListBoxItem>
</Items>
</telerik:RadListBox>
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 ListBoxes on a given page, each of them may have a different activation combination.
In this particular example, the [CommandKey] and the [FocusKey] for the first ListBox can be customized in the Demo Configurator.
Note: It is recommended to avoid [CommandKey] + [FocusKey] combinations matching keyboard shortcuts used in the browsers. If the combination coincides with an existing shortcut the control may be unable to focus.
Pressing [CommandKey] + [FocusKey]) puts the focus on the ListBox allowing you to navigate the items:
Arrow Navigation / Selection
- Down Arrow / Up Arrow keys select next/previous item.
- Shift + Arrow Keys selects multiple items.
- Ctrl + Space adds currently active item to the selection.
- Del deletes currently selected item (if
AllowDelete
is set to true
).
Transfer
- Ctrl + Right Arrow transfers to destination.
- Ctrl + Left Arrow on destination transfers back to source.
Reorder
- Ctrl + Shift + Up Arrow reorders upwards.
- Ctrl + Shift + Down Arrow reorders downwards.
Mark Matches
Starts with
- Start typing to highlight the matching items.
- Esc clears the mask.
- Backspace removes a single character.
First letter
- Any key navigates to a matching item.
- Subsequent press on the same key iterates over the matches.