Is it possible, out of the box, to sort a .NET DataGridView column using only the keyboard?
I understand there is a SelectionMode property, but changing this merely allows me to select, using Shift+Space, an entire row or column, but this doesn’t have the same effect as clicking the header with the mouse and causing a sort.
The reason I ask is because I am working on accessibility issues and would like to avoid relying on the mouse.
Thanks for any assistance.
The first thing you will need to do is set the
KeyPreviewproperty toTruein your form properties.Then in the events you need to add an event handler for the
KeyDown()eventThen add some code something like this: