Change Datagridview keys

Nusrat Bharucha 140 Reputation points
2023-10-12T15:03:05.82+00:00

hi, i am trying creating a my own custom DataGridview in which when i press enter the control reaches to next column and when it reaches the last column, it changes it row. But i found out that this is not the default behavior of doing. Please help me out in writing a function for this . Also suggest which is the event which should be declared in datagridview .

Developer technologies | Windows Forms
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

Answer accepted by question author
  1. KOZ6.0 6,735 Reputation points
    2023-10-12T16:34:57.4566667+00:00
            protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
                if (keyData == Keys.Enter) {
                    return ProcessTabKey(Keys.Tab);
                }
                return base.ProcessCmdKey(ref msg, keyData);
            }
            ```
    
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.