Skip to main content
All docs
V23.2

ASPxClientGridKeyboardEventArgs Class

Contains data for ASPxCardView, ASPxGridView, and ASPxVerticalGrid client-side keyboard events.

Declaration

declare class ASPxClientGridKeyboardEventArgs extends ASPxClientGridKeyboardEventArgsBase

Remarks

An ASPxClientGridKeyboardEventArgs object contains information on the pressed key (the keyCode and htmlEvent properties). You can also use the isAltPressed, isCtrlPressed, and isShiftPressed object properties that specify whether a user presses the corresponding modifier keys.

In the example below, the grid allows users to press the custom Ctrl+Space shortcut (the Space key’s integer code is 32) to expand all group rows.

var spaceKeyCode = 32;

function onKeyDown(s, e) {
    if (e.isCtrlPressed && e.keyCode == spaceKeyCode) {
        s.ExpandAll()
    }
}
<dx:ASPxGridView ID="grid" runat="server" ...>
    <Settings ShowGroupPanel="true" />
    <ClientSideEvents KeyDown="onKeyDown" />
    <Columns>
        <dx:GridViewDataColumn FieldName="ShipName" />
        <!--...-->
    </Columns>
</dx:ASPxGridView>

Inheritance

See Also