Keyboard Support
Note: Changing the shortcuts used for accessing RadGrid can tally with browser shortcuts which have higher priority.
The keyboard navigation feature of Telerik RadGrid allows you to:
Focus
- Focus the grid through a user-specified key combination
Navigate
- Up Arrow/Down Arrow - navigate through the grid records
- Page up/Page down - advance/return the pager
Select
- Space - select grid items
- Ctrl + Shift - select multiple grid item
Edit/Insert
- Ctrl + I - insert a new item
- Enter - edit rows
- Enter - update/insert rows
- Esc - exit EDIT/INSERT mode
Expand/Collapse
- Left Arrow + Right Arrow - Expand/Collapse detail tables
To enable this feature you have to set the
ClientSettings -> AllowKeyboardNavigation
property of the grid to
true (it's default value is
false).
The grid also features an additional property
ClientSettings -> KeyboardNavigationSettings ->
EnableKeyboardShortcuts which when set to false will disable all keyboard navigation shortcuts
except for the
Up/Down and
Page Up]/Page Down keys.
This is done with a view to facilitating the developer if he intends to implement his own scenario if the
above-listed keys (with the exceptions mentioned) have been pressed.
To specify the key combination that focuses the grid you need to set the
ClientSettings -> KeyboardNavigationSettings -> FocusKey -
the first key is preset to
Ctrl by design.
The
ClientSettings -> KeyboardNavigationSettings -> InitInsertKey and
ClientSettings -> KeyboardNavigationSettings -> RebindKey properties are used
to provide shortcuts for opening RadGrid insert form and for rebinding RadGrid. The default values are
Ctrl +
I and
Ctrl
+
R respectively where the first key is preset to
Ctrl by design.
The ClientSettings -> KeyboardNavigationSettings -> ExpandDetailTableKey and ClientSettings ->
KeyboardNavigationSettings -> CollapseDetailTableKey properties are used to provide shortcuts for expanding
or collapsing the active row's detail table. The default values are
Left Arrow Key
and
Right Arrow Key. Upon changing these values, you will need to hold
Shift
down for the new keys to take effect.
To enable the Update/Insert rows by hitting the
Enter key feature you have to set the
KeyboardNavigationSettings -> AllowSubmitOnEnter property to
True. Also enable the validation when
AllowSubmitOnEnter
is set to
True you have to set the
ValidationSettings -> EnableValidation to
True and specify
which command needs validation through
CommandsToValidate property:
<ValidationSettings CommandsToValidate="PefrormInsert, Update" EnableValidation="true" />
To validate a secific validation group you have to set the
KeyboardNavigationSettings -> ValidationGroup
property to the name of the group:
<KeyboardNavigationSettings EnableKeyboardShortcuts="true"
AllowSubmitOnEnter="true" ValidationGroup="CustomValidatioGroup" />
To allow the active row to cycle to the beginning upon having reached the end of the grid table, you have to set
ClientSettings -> KeyboardNavigationSettings -> AllowActiveRowCycle property to
true.
The keyboard navigation is especially useful when you do not want your user to be
dependand on mouse clicks when interacting with the control. It is designed in par with the Section 508 accessibility
standards.