DataGridTextBox.IsInEditOrNavigateMode Property


Gets or sets a value indicating whether the DataGridTextBox is in a mode that allows either editing or navigating.

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

public bool IsInEditOrNavigateMode { get; set; }

Property Value

Type: System.Boolean

true if the controls is in navigation mode, and editing has not begun; otherwise, false. The default is true.

The IsInEditOrNavigateMode property is used within the ProcessKeyMessage to determine how to process key press events, to check the state of the DataGridTextBox. For example, if one of the navigation (arrow) keys is pressed, the appropriate action for the state of the control must occur.

The following code example demonstrates the use of this member.

// Handle event to show the state of 'IsInEditOrNavigateMode'.
private void Button_ClickEvent(object sender, EventArgs e)

   if (myDataGridTextBox.IsInEditOrNavigateMode)
      // DataGridTextBox has not been edited.
      MessageBox.Show("Editing of DataGridTextBox not begun, IsInEditOrNavigateMode = True");
      // DataGridTextBox has been edited.
      MessageBox.Show("Editing of DataGridTextBox begun, IsInEditOrNavigateMode = False");

.NET Framework
Available since 1.1
Return to top