Clear text on pressing escape key

vijay kumar 120 Reputation points
2023-10-06T21:37:58+00:00

I am a new learner in c# and windows forms . I, in my org . have created a custom datagridview . it has four columns . but i am stuck at a task in which on presses escape key in the first three columns ,whatever data we have typed in , we need to clear it out . Also we need to made sure that column 2 and 3 can only numeric values and must be non negative with only allowing two digits after decimal point .

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,927 questions
C#
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.
11,418 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. KOZ6.0 6,580 Reputation points
    2023-10-06T22:38:07.57+00:00

    In DataGridView, Escape key is used to cancel editing. Let's assign it to another key.


Your answer

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