DataGridTextBox.IsInEditOrNavigateMode Property

Definition

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

public:
 property bool IsInEditOrNavigateMode { bool get(); void set(bool value); };
public bool IsInEditOrNavigateMode { get; set; }
member this.IsInEditOrNavigateMode : bool with get, set
Public Property IsInEditOrNavigateMode As Boolean

Property Value

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

Examples

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" );
      }
      else
      {         
         // DataGridTextBox has been edited.
         MessageBox::Show( "Editing of DataGridTextBox begun, IsInEditOrNavigateMode = False" );
      }
   }
// 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");
   }
   else
   {
      // DataGridTextBox has been edited.
      MessageBox.Show("Editing of DataGridTextBox begun, IsInEditOrNavigateMode = False");
   }
}
' Handle event to show the state of 'IsInEditOrNavigateMode'.
Private Sub Button_ClickEvent(sender As Object, e As EventArgs)
   
   If myDataGridTextBox.IsInEditOrNavigateMode Then
      ' DataGridTextBox has not been edited.
      MessageBox.Show("Editing of DataGridTextBox not begun,IsInEditOrNavigateMode = True")
   Else
      ' DataGridTextBox has been edited.
      MessageBox.Show("Editing of DataGridTextBox begun,IsInEditOrNavigateMode = False")
   End If
End Sub

Remarks

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.

Applies to