DataGridViewTextBoxCell.KeyEntersEditMode Method

Note: This method is new in the .NET Framework version 2.0.

Determines if edit mode should be started based on the given key.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in

public override bool KeyEntersEditMode (
	KeyEventArgs e
public boolean KeyEntersEditMode (
	KeyEventArgs e
public override function KeyEntersEditMode (
	e : KeyEventArgs
) : boolean



A KeyEventArgs that represents the key that was pressed.

Return Value

true if edit mode should be started; otherwise, false.

When the EditMode property of the DataGridView control is set to EditOnKeystroke or EditOnKeystrokeOrF2, the control uses this method to determine whether a key other than F2 that is pressed by the user while this cell has focus will cause the cell to enter edit mode.

This method returns true if the e parameter indicates an ordinary data-entry key (such as a letter, number, punctuation mark, or the SPACE key) unmodified by ALT or CTRL, excluding SHIFT+SPACE, which is used by the control for selection purposes. For more information, see Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions