Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

WinExplorerView.ItemKeyDown Event

Occurs when an end-user presses any keyboard key, while an item within this WinExplorerView is selected.

Namespace: DevExpress.XtraGrid.Views.WinExplorer

Assembly: DevExpress.XtraGrid.v24.2.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

#Declaration

[DXCategory("Action")]
public event WinExplorerViewItemKeyDownEventHandler ItemKeyDown

#Event Data

The ItemKeyDown event's data class is DevExpress.XtraGrid.Views.WinExplorer.WinExplorerViewItemKeyEventArgs.

#Remarks

The ItemKeyDown event is raised whenever an end-user clicks any keyboard key if the WinExplorerView currently has a selected item (items). This also applies to keys used for navigation within the WinExplorerView (arrow keys, Page Up, Home, End etc.). Handle this event to get detailed information about the pressed key and perform specific actions depending on the key. The following code illustrates how to bind the WinExplorerView.MoveFirst and WinExplorerView.MoveLast methods to specific keyboard keys.

private void winExplorerView1_ItemKeyDown(object sender, WinExplorerViewItemKeyEventArgs e) {
    if (e.KeyInfo.KeyData == Keys.L) winExplorerView1.MoveLast();
    if (e.KeyInfo.KeyData == Keys.F) winExplorerView1.MoveFirst();
}
See Also