C# – How to disable per cell tab stop of DataGridView in C#

cdatagridviewtabs

How to disable per cell tab stop of DataGridView in C# ?

If users focus on DataGridView and press 'Tab', I hope the next control would be focused, not focusing on next cell of DataGridView.

How can I do that?

Best Answer

Set the DataGridView.StandardTab property to true

Here is the description for the property:

"Indicates whether the TAB key moves the focus to the next control in the tab order rather than moving focus to the next cell in the control."

In VS2012 .NET 4 this was false by default (didn't see default state in docs) after adding a new datagridview to a form.

https://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.standardtab(v=vs.110).aspx

I'd recommend when searching for a solution to a problem, type the object and desired functionality into google followed by a space and then the text msdn. This solves about 40% of my dilemmas. If that doesn't work replace msdn with stackoverflow. This solves another 50%. The last 10% are the result of taking a break and coming back to it.