ASPxClientTreeList.KeyUp Event
Occurs when a user releases the pressed key while ASPxTreeList has focus.
#Declaration
KeyUp: ASPxClientEvent<ASPxClientTreeListKeyboardEventHandler<ASPxClientTreeList>>
#Event Data
The KeyUp event's data class is ASPxClientTreeListKeyboardEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
handled |
Specifies whether to suppress the keyboard key’s default action.
Inherited from ASPx |
html |
Gets a DHTML event object that relates to the processed event.
Inherited from ASPx |
is |
Specifies whether a user presses the Alt key when the event occurs.
Inherited from ASPx |
is |
Specifies whether a user presses the Ctrl key when the event occurs.
Inherited from ASPx |
is |
Specifies whether a user presses the Shift key when the event occurs.
Inherited from ASPx |
key |
Gets a key code.
Inherited from ASPx |
#Remarks
Handle the KeyUp
event to process release actions for specific keys. To get information on the released key (for instance, its key or code value), use the e.htmlEvent property. You can also use the e.keyCode event property to get the key code as an integer value.
In the example below, ASPxTreeList collapses all expanded nodes when a user releases the custom Ctrl
+Space
shortcut (the Space
key’s integer code is 32).
var spaceKeyCode = 32;
function onKeyUp(s, e) {
if (e.isCtrlPressed && e.keyCode == spaceKeyCode) {
s.CollapseAll();
}
}
<dx:ASPxTreeList ID="treeList" runat="server" ...>
<ClientSideEvents KeyUp="onKeyUp" />
<Columns>
<dx:TreeListDataColumn FieldName="DepartmentName" Caption="Department" />
<!--...-->
</Columns>
</dx:ASPxTreeList>