Skip to content

Redirect Key and MouseWheel event to a DataGridView to preserve scrolling and row selection

Notifications You must be signed in to change notification settings

MaxBGitHub/Control-Redirect-Input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Control-Redirect-Input

Redirect PreviewKeyDownEventArgs and MouseEventArg values to a DataGridView

Description

By redirecting the PreviewKeyDownEventArgs and redirecting the values of the MouseEventArgs you can ensure scrolling and Up/Down/PageUp/PageDown/ etc. functionality for the DataGridView no matter which control has focus.

This can be usefull e.g. if you still want to scroll the DataGridView while editing a filter input in a TextBox.

References

  • System.Windows.Forms
  • System.Reflection

Implementation

Add the code to the desired System.Windows.Forms.Form and change the name of dataGridView1 to the name of your own DataGridView.

Built With

Visual Studio 2017

About

Redirect Key and MouseWheel event to a DataGridView to preserve scrolling and row selection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages