Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keyboard navigation for RadListBox with icons

I am using RadListBox to show a list of items. Each item has an icon. The requirement is jumping on the item when a the first letter of that item is pressed.

For example: It should focus on "Dock" when letter "D" is pressed

Is there any built-in feature to accomplish this>

enter image description here

like image 618
Ned Avatar asked Sep 09 '17 19:09

Ned


1 Answers

This functionality is built into the RadListBox right out of the box.

You must have the list box focused and then type a key to select the item with the first letter matching the key that was pressed. In order to focus on the list box you can either: click with the mouse, tab to it, set focus in JS, or use the KeyboardNavigationSettings.CommandKey and KeyboardNavigationSettings.FocusKey to help aid with keyboard navigation.

Example:

 RadListBox1 = new RadListBox()
 RadListBox1.KeyboardNavigationSettings.CommandKey = KeyboardNavigationModifier.Alt;
 RadListBox1.KeyboardNavigationSettings.FocusKey = KeyboardNavigationKey.L;

You can also use EnableMarkMatches to highlight more than one match if necessary and for typing more than one letter for selecting.

Reference: Telerik RadListBox Keyboard Navigation Demo << This has all the sample code you should need.

like image 51
chambo Avatar answered Nov 13 '22 04:11

chambo