windowsforms-devexpress-dot-xtragrid-dot-views-dot-winexplorer-dot-winexplorerview-bd78a77a.md
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.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
[DXCategory("Action")]
public event WinExplorerViewItemKeyDownEventHandler ItemKeyDown
<DXCategory("Action")>
Public Event ItemKeyDown As WinExplorerViewItemKeyDownEventHandler
The ItemKeyDown event's data class is DevExpress.XtraGrid.Views.WinExplorer.WinExplorerViewItemKeyEventArgs.
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();
}
Private Sub winExplorerView1_ItemKeyDown(sender As Object, e As WinExplorerViewItemKeyEventArgs)
If e.KeyInfo.KeyData = Keys.L Then
winExplorerView1.MoveLast()
End If
If e.KeyInfo.KeyData = Keys.F Then
winExplorerView1.MoveFirst()
End If
End Sub
See Also