event Edit (Node as Node, ByRef Cancel as Boolean)
Occurs just before editing the focused node.

TypeDescription
Node as Node A Node object being edited.
Cancel as Boolean (By Reference) A boolean expression that indicates whether the edit operation is canceled.
The Edit event is fired when the editing operation is about to begin. Use the Edit event to disable editing specific nodes. Use the Editor property to assign an editor to a node. Use the Editors property to access the control's Editors collection. Use the Edit method to programmatically edit a node, if the AutoEdit property is False. 

If a node has an editor assigned the node's editor is applied to the:

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.

Syntax for Edit event, /NET version, on:

private void EditEvent(object sender,exontrol.EXMLGRIDLib.Node Node,ref bool Cancel)
{
}

Private Sub EditEvent(ByVal sender As System.Object,ByVal Node As exontrol.EXMLGRIDLib.Node,ByRef Cancel As Boolean) Handles EditEvent
End Sub

Syntax for Edit event, /COM version, on:

private void EditEvent(object sender, AxEXMLGRIDLib._IXMLGridEvents_EditEvent e)
{
}

void OnEdit(LPDISPATCH Node,BOOL FAR* Cancel)
{
}

void __fastcall Edit(TObject *Sender,Exmlgridlib_tlb::INode *Node,VARIANT_BOOL * Cancel)
{
}

procedure Edit(ASender: TObject; Node : INode;var Cancel : WordBool);
begin
end;

procedure EditEvent(sender: System.Object; e: AxEXMLGRIDLib._IXMLGridEvents_EditEvent);
begin
end;

begin event Edit(oleobject Node,boolean Cancel)
end event Edit

Private Sub EditEvent(ByVal sender As System.Object, ByVal e As AxEXMLGRIDLib._IXMLGridEvents_EditEvent) Handles EditEvent
End Sub

Private Sub Edit(ByVal Node As EXMLGRIDLibCtl.INode,Cancel As Boolean)
End Sub

Private Sub Edit(ByVal Node As Object,Cancel As Boolean)
End Sub

LPARAMETERS Node,Cancel

PROCEDURE OnEdit(oXMLGrid,Node,Cancel)
RETURN

Syntax for Edit event, /COM version (others), on:

<SCRIPT EVENT="Edit(Node,Cancel)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function Edit(Node,Cancel)
End Function
</SCRIPT>

Procedure OnComEdit Variant llNode Boolean llCancel
	Forward Send OnComEdit llNode llCancel
End_Procedure

METHOD OCX_Edit(Node,Cancel) CLASS MainDialog
RETURN NIL

void onEvent_Edit(COM _Node,COMVariant /*bool*/ _Cancel)
{
}

function Edit as v (Node as OLE::Exontrol.XMLGrid.1::INode,Cancel as L)
end function

function nativeObject_Edit(Node,Cancel)
return

The following VB sample disables editing nodes that contain child nodes ( parent nodes ):

Private Sub Form_Load()
    With XMLGrid1
        .BeginUpdate
            .AutoEdit = True
            .Editors.Add "Edit", EditType
            With .Nodes
                With .Add("Root").Nodes
                    .Add "Child 1", "text1"
                    .Add "Child 2", "text2"
                End With
            End With
        .EndUpdate
    End With
End Sub

Private Sub XMLGrid1_AddNode(ByVal NewNode As EXMLGRIDLibCtl.INode)
    NewNode.Editor = "Edit"
End Sub

Private Sub XMLGrid1_Edit(ByVal Node As EXMLGRIDLibCtl.INode, Cancel As Boolean)
    Cancel = Not Node.Nodes.Count = 0
End Sub

The following C++ sample disables editing nodes that contain child nodes ( parent nodes ):

#include "Node.h"
void OnEditXmlgrid1(LPDISPATCH Node, BOOL FAR* Cancel) 
{
	CNode node( Node ); node.m_bAutoRelease = FALSE;
	if ( node.GetNodes().GetCount() != 0 )
		*Cancel = TRUE;
}

The following VB.NET sample disables editing nodes that contain child nodes ( parent nodes ):

Private Sub AxXMLGrid1_EditEvent(ByVal sender As Object, ByVal e As AxEXMLGRIDLib._IXMLGridEvents_EditEvent) Handles AxXMLGrid1.EditEvent
    If (e.node.Nodes.Count <> 0) Then
        e.cancel = True
    End If
End Sub

The following C# sample disables editing nodes that contain child nodes ( parent nodes ):

private void axXMLGrid1_EditEvent(object sender, AxEXMLGRIDLib._IXMLGridEvents_EditEvent e)
{
	if (e.node.Nodes.Count != 0)
		e.cancel = true;
}

The following VFP sample disables editing nodes that contain child nodes ( parent nodes ):

*** ActiveX Control Event ***
LPARAMETERS node, cancel

if !( node.Nodes.Count = 0 )
	cancel = .t.
endif