Skip to main content
All docs
V24.2

ASPxClientTreeListKeyboardEventArgs Class

Contains data for ASPxTreeList client-side keyboard events.

Declaration

declare class ASPxClientTreeListKeyboardEventArgs extends ASPxClientGridKeyboardEventArgsBase

Remarks

An ASPxClientTreeListKeyboardEventArgs 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, ASPxTreeList allows users to press the custom Ctrl+X shortcut (the X key’s integer code is 88) to export its data to a PDF document.

var xKeyCode = 88;

function onKeyDown(s, e) {
    if (e.isCtrlPressed && e.keyCode == xKeyCode) {
        s.ExportTo(ASPxClientTreeListExportFormat.Pdf);
    }
}
<dx:ASPxTreeList ID="treeList" runat="server" ...>
    <SettingsExport EnableClientSideExportAPI="true" />
    <ClientSideEvents KeyDown="onKeyDown" />
    <Columns>
        <dx:TreeListDataColumn FieldName="DepartmentName" Caption="Department" />
        <!--...-->
    </Columns>
</dx:ASPxTreeList>

Inheritance

See Also