When listening to KeyPress events in a DataGridView , you will only listen to events when the actual DataGridView control has focus, and not when you are typing text in a column (e.g. DataGridViewTextBoxColumn ) in the grid. If you want to listen to key events (or any event) in the column, you need to first listen to an event that will fire when the DataGridViewTextBoxColumn control is entering editing mode. FooDataGridView += DataGridViewEditingControlShowingEventHandler(FooDataGridView_EditingControlShowing); Then you will be able to listen for the KeyPress event: private TextBox areaValueTextBox = null; void FooDataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if (e.Control is TextBox) { if (areaValueTextBox == null) { areaValueTextBox = e.Control as TextBox...
A blog about software development and architecture. The main focus is .NET and Open Source.