The Form is capturing the TAB key. That is how a Windows form normally works to change focus to the next control within the Form's tab order.
So..., you have to change how the WinForm object (
not the DataGridView ) handle the TAB key:
private bool isTabCaptureOn = false;
protected override bool ProcessTabKey(bool forward)
{
if (isTabCaptureOn)
{
return true;
}
else
{
return base.ProcessTabKey(forward);
}
}
When isTabCaptureOn is true, the form will allow you to assign and work with the DataGridView's
KeyUp()
method to process the TAB key in the fashion that you are seeking. However, you will not be able to TAB out of the control to another control unless you develop a method to turn capture off again.
I'll leave that exercise to you....