How do you override the enter key in a datagridview so that it will set focus to the next column instead to the next row?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
All you need to do is handle the KeyDown event of the DataGridView and in the handler, check if the current key pressed is an Enter key. If so, just set the CurrentCell of the DataGridView to the next cell (also check if this is the last cell in the row, in that case, move to the first cell of the next Row.)