Back to Devexpress

ASPxClientGridKeyboardEventArgs Class

aspnet-js-aspxclientgridkeyboardeventargs.md

latest2.0 KB
Original Source

ASPxClientGridKeyboardEventArgs Class

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

Declaration

ts
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.

js
var spaceKeyCode = 32;

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

Inheritance

ASPxClientEventArgs ASPxClientGridKeyboardEventArgsBase ASPxClientGridKeyboardEventArgs

See Also

KeyDown

Keyboard Navigation

ASPxClientGridKeyboardEventArgs Members