method XMLGrid.Edit ([Options as Variant])
Edits the focused node.

TypeDescription
Options as Variant Reserved.
Use the Edit method to programmatically edit the focused node. Use the FocusNode property to specify the control's focused node. Use the Selected property to changes the selection. When user changes the selection the focused node is moved too.  Use the ShowFocusRect property to mark focused node with a thin rectangle. Use the AutoEdit property to specify whether the control starts editing a cell as soon as the user moves the focused node. Use the Editor property to assign an editor to a node. Use the Editing property to check whether the control is running in the edit mode.

The edit events are fired in the following order:

  1. Edit event. Prevents editing nodes, before showing the node's editor.

  2. EditOpen event. The edit operation started, the node's editor is shown. The Editing property gives the window's handle of the built-in editor being shown.

  3. Change event. The Change event is fired only if the user types ENTER key, the user selects a new value from a predefined data list, or focus a new node.

  4. EditClose event. The node's editor is hidden and closed.

The following sample starts editing a node as soon as user presses the F2 key:

Private Sub XMLGrid1_KeyDown(KeyCode As Integer, Shift As Integer)
    With XMLGrid1
        If .Editing = 0 Then
            If KeyCode = vbKeyF2 Then
                .Edit
            End If
        End If
    End With
End Sub