event UserEditorOleEvent (Object as Object, Ev as OleEvent, ByRef CloseEditor as Boolean, Node as Node)
Occurs when an user editor fires an event.

TypeDescription
Object as Object An object created by UserEditor property.
Ev as OleEvent An OleEvent object that holds information about the event 
CloseEditor as Boolean (By Reference) A boolean expression that indicates whether the control should close the user editor.
Node as Node A Node object where the ActiveX editor is opened. 
The UserEditorOleEvent is fired every time when an user editor object fires an event. The information about fired event is stored by Ev parameter. The CloseEditor parameter is useful to inform the control when the editor should be hidden. The UserEditorOpen event is fired when the control shows an ActiveX editor. The control fires the UserEditorClose event when the user closes the ActiveX editor ( for instance, when he clicks outside the editing node ). Use the Add method and UserEditorType type to add an ActiveX editor to the control. Use the UserEditor method to create an ActiveX editor. Use the UserEditorObject property to get the ActiveX editor created by the UserEditor method.

Syntax for UserEditorOleEvent event, /NET version, on:

private void UserEditorOleEvent(object sender,object Obj,exontrol.EXMLGRIDLib.OleEvent Ev,ref bool CloseEditor,exontrol.EXMLGRIDLib.Node Node)
{
}

Private Sub UserEditorOleEvent(ByVal sender As System.Object,ByVal Obj As Object,ByVal Ev As exontrol.EXMLGRIDLib.OleEvent,ByRef CloseEditor As Boolean,ByVal Node As exontrol.EXMLGRIDLib.Node) Handles UserEditorOleEvent
End Sub

Syntax for UserEditorOleEvent event, /COM version, on:

private void UserEditorOleEvent(object sender, AxEXMLGRIDLib._IXMLGridEvents_UserEditorOleEventEvent e)
{
}

void OnUserEditorOleEvent(LPDISPATCH Object,LPDISPATCH Ev,BOOL FAR* CloseEditor,LPDISPATCH Node)
{
}

void __fastcall UserEditorOleEvent(TObject *Sender,IDispatch *Object,Exmlgridlib_tlb::IOleEvent *Ev,VARIANT_BOOL * CloseEditor,Exmlgridlib_tlb::INode *Node)
{
}

procedure UserEditorOleEvent(ASender: TObject; Object : IDispatch;Ev : IOleEvent;var CloseEditor : WordBool;Node : INode);
begin
end;

procedure UserEditorOleEvent(sender: System.Object; e: AxEXMLGRIDLib._IXMLGridEvents_UserEditorOleEventEvent);
begin
end;

begin event UserEditorOleEvent(oleobject Object,oleobject Ev,boolean CloseEditor,oleobject Node)
end event UserEditorOleEvent

Private Sub UserEditorOleEvent(ByVal sender As System.Object, ByVal e As AxEXMLGRIDLib._IXMLGridEvents_UserEditorOleEventEvent) Handles UserEditorOleEvent
End Sub

Private Sub UserEditorOleEvent(ByVal Object As Object,ByVal Ev As EXMLGRIDLibCtl.IOleEvent,CloseEditor As Boolean,ByVal Node As EXMLGRIDLibCtl.INode)
End Sub

Private Sub UserEditorOleEvent(ByVal Object As Object,ByVal Ev As Object,CloseEditor As Boolean,ByVal Node As Object)
End Sub

LPARAMETERS Object,Ev,CloseEditor,Node

PROCEDURE OnUserEditorOleEvent(oXMLGrid,Object,Ev,CloseEditor,Node)
RETURN

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

<SCRIPT EVENT="UserEditorOleEvent(Object,Ev,CloseEditor,Node)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function UserEditorOleEvent(Object,Ev,CloseEditor,Node)
End Function
</SCRIPT>

Procedure OnComUserEditorOleEvent Variant llObject Variant llEv Boolean llCloseEditor Variant llNode
	Forward Send OnComUserEditorOleEvent llObject llEv llCloseEditor llNode
End_Procedure

METHOD OCX_UserEditorOleEvent(Object,Ev,CloseEditor,Node) CLASS MainDialog
RETURN NIL

void onEvent_UserEditorOleEvent(COM _Object,COM _Ev,COMVariant /*bool*/ _CloseEditor,COM _Node)
{
}

function UserEditorOleEvent as v (Object as P,Ev as OLE::Exontrol.XMLGrid.1::IOleEvent,CloseEditor as L,Node as OLE::Exontrol.XMLGrid.1::INode)
end function

function nativeObject_UserEditorOleEvent(Object,Ev,CloseEditor,Node)
return

The following VB sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:

Private Sub XMLGrid1_UserEditorOleEvent(ByVal Object As Object, ByVal Ev As EXMLGRIDLibCtl.IOleEvent, CloseEditor As Boolean, ByVal Node As EXMLGRIDLibCtl.INode)
    If (Ev.Name = "Change") Then
        Node.Value = Object.Select(0)
        CloseEditor = True
    End If
    
    If (Ev.Name = "KeyPress") Then
        Dim l As Long
        l = Ev(0).Value
        If l = vbKeyEscape Then
            CloseEditor = True
        End If
    End If
End Sub

the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ):

With XMLGrid1.Editors
    With .Add("excombobox", UserEditorType)
        .UserEditor "Exontrol.ComboBox", ""
        With .UserEditorObject
            .BeginUpdate
            .LabelHeight = XMLGrid1.NodeHeight - 3
            .LinesAtRoot = True
            .HeightList = 256
            .WidthList = 256
            .IntegralHeight = True
            .Columns.Add ("Name")
            .Columns.Add ("Value")
            .ColumnAutoResize = True
            With .Items
                Dim h As Long, h1 As Long
                h = .AddItem("Item 1")
                .CellCaption(h, 1) = "Item 1.2"
                h1 = .InsertItem(h, , "SubItem 1")
                .CellCaption(h1, 1) = "SubItem 1.2"
                h1 = .InsertItem(h, , "SubItem 2")
                .CellCaption(h1, 1) = "SubItem 2.2"
                .ExpandItem(h) = True
            End With
            .EndUpdate
        End With
    End With
End With

The following C++ sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:

#import <exmlgrid.dll>
#import <excombobox.dll>
void OnUserEditorOleEventXmlgrid1(LPDISPATCH Object, LPDISPATCH Ev, BOOL FAR* CloseEditor, LPDISPATCH Node) 
{
	EXMLGRIDLib::IOleEventPtr spEvent = Ev;
	EXCOMBOBOXLib::IComboBoxPtr spComboBox = Object;
	if ( spComboBox != NULL )
		if ( spEvent != NULL  )
		{
			if ( spEvent->Name.operator ==( "Change" ) )
			{
				CNode node( Node );
				node.SetValue( spComboBox->GetSelect( COleVariant( (long)0 ) ) );
				*CloseEditor = TRUE;
			}
			else
				if ( spEvent->Name.operator ==( "KeyPress" ) )
				{
					// gets the KeyCode parameter
					EXMLGRIDLib::IOleEventParamPtr spParam;
					if ( SUCCEEDED( spEvent->get_Param( COleVariant( (long)0 ), &spParam ) ) )
					{
						COleVariant vtI4;
						vtI4.ChangeType( VT_I4, &spParam->Value );
						if ( V_I4( &vtI4) == VK_ESCAPE )
							*CloseEditor = TRUE;
					}
				}
		}
}

the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ), so we need to call the #import <excombobox.dll> in order to include definitions for objects and types in the ExComboBox control. The #import <excombobox.dll> creates EXCOMBOBOXLib namespace that includes all definitions for objects and types that the ExComboBox control exports.

#include "Editor.h"
#include "Editors.h"
COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR;
CEditors editors = m_xmlgrid.GetEditors();
CEditor editor = editors.Add( COleVariant( "excombobox" ), 16 /*UserEditorType*/ );
editor.UserEditor( "Exontrol.ComboBox", "" );
EXCOMBOBOXLib::IComboBoxPtr spComboBox = editor.GetUserEditorObject();
if ( spComboBox != NULL )
{
	spComboBox->BeginUpdate();
	spComboBox->LabelHeight = m_xmlgrid.GetNodeHeight() - 3;
	spComboBox->LinesAtRoot = EXCOMBOBOXLib::exLinesAtRoot;
	spComboBox->put_HeightList( vtMissing, 256 );
	spComboBox->put_WidthList( vtMissing, 256 );
	spComboBox->IntegralHeight = true;
	spComboBox->Columns->Add("Name");
	spComboBox->Columns->Add("Value");
	spComboBox->ColumnAutoResize = true;
	EXCOMBOBOXLib::IItemsPtr spItems = spComboBox->Items;
	long h = spItems->AddItem(COleVariant( "Item 1" ));
	spItems->put_CellCaption(COleVariant(h),COleVariant((long)1), COleVariant( "Item 1.2" ) );
	long h1 = spItems->InsertItem(h, vtMissing, COleVariant( "SubItem 1") );
	spItems->put_CellCaption(COleVariant(h1),COleVariant((long)1), COleVariant( "SubItem 1.2" ) );
	h1 = spItems->InsertItem(h, vtMissing, COleVariant( "SubItem 2") );
	spItems->put_CellCaption(COleVariant(h1),COleVariant((long)1), COleVariant( "SubItem 2.2" ) );
	spItems->put_ExpandItem(h, true );
	spComboBox->EndUpdate();
}

The following VB.NET sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:

Private Sub AxXMLGrid1_UserEditorOleEvent(ByVal sender As Object, ByVal e As AxEXMLGRIDLib._IXMLGridEvents_UserEditorOleEventEvent) Handles AxXMLGrid1.UserEditorOleEvent
    If (e.ev.Name = "Change") Then
        e.node.Value = e.object.Select(0)
        e.closeEditor = True
    End If

    If (e.ev.Name = "KeyPress") Then
        Dim l As Integer = e.ev(0).Value
        If l = Keys.Escape Then
            e.closeEditor = True
        End If
    End If
End Sub

the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ):

With AxXMLGrid1.Editors
    With .Add("excombobox", EXMLGRIDLib.EditTypeEnum.UserEditorType)
        .UserEditor("Exontrol.ComboBox", "")
        With .UserEditorObject
            .BeginUpdate()
            .LabelHeight = AxXMLGrid1.NodeHeight - 3
            .LinesAtRoot = True
            .HeightList = 256
            .WidthList = 256
            .IntegralHeight = True
            .Columns.Add("Name")
            .Columns.Add("Value")
            .ColumnAutoResize = True
            With .Items
                Dim h, h1 As Integer
                h = .AddItem("Item 1")
                .CellCaption(h, 1) = "Item 1.2"
                h1 = .InsertItem(h, , "SubItem 1")
                .CellCaption(h1, 1) = "SubItem 1.2"
                h1 = .InsertItem(h, , "SubItem 2")
                .CellCaption(h1, 1) = "SubItem 2.2"
                .ExpandItem(h) = True
            End With
            .EndUpdate()
        End With
    End With
End With

The following C# sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:

private void axXMLGrid1_UserEditorOleEvent(object sender, AxEXMLGRIDLib._IXMLGridEvents_UserEditorOleEventEvent e)
{
	if (e.ev.Name == "Change")
	{
		EXCOMBOBOXLib.ComboBox comboBox = e.@object as EXCOMBOBOXLib.ComboBox;
		if ( comboBox != null )
			e.node.Value = comboBox.get_Select(0);
		e.closeEditor = true;
	}
	else
		if (e.ev.Name == "KeyPress")
		{
			if (Convert.ToInt16(e.ev[0].Value) == Convert.ToInt16(Keys.Escape))
				e.closeEditor = true;
		}
}

the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ):

EXMLGRIDLib.Editor editor = axXMLGrid1.Editors.Add("excombobox", EXMLGRIDLib.EditTypeEnum.UserEditorType);
editor.UserEditor("Exontrol.ComboBox", "");
EXCOMBOBOXLib.ComboBox comboBox = editor.UserEditorObject as EXCOMBOBOXLib.ComboBox;
if ( comboBox != null )
{
	comboBox.BeginUpdate();
	comboBox.LabelHeight = axXMLGrid1.NodeHeight - 3;
	comboBox.LinesAtRoot = EXCOMBOBOXLib.LinesAtRootEnum.exLinesAtRoot ;
	comboBox.set_HeightList( null, 256 );
	comboBox.set_WidthList( null, 256 );
	comboBox.IntegralHeight = true;
	comboBox.Columns.Add("Name");
	comboBox.Columns.Add("Value");
	comboBox.ColumnAutoResize = true;
	EXCOMBOBOXLib.Items items = comboBox.Items;
    int h = items.AddItem("Item 1");
	items.set_CellCaption(h, 1, "Item 1.2" );
	int h1 = items.InsertItem(h, null, "SubItem 1");
	items.set_CellCaption(h1, 1,"SubItem 1.2");
	h1 = items.InsertItem(h, null, "SubItem 2");
	items.set_CellCaption(h1, 1,"SubItem 2.2");
	items.set_ExpandItem(h, true);
    comboBox.EndUpdate();
}

In C# your project needs a new reference to the Exontrol's ExComboBox control library. Use the Project\Add Reference\COM item to add new reference to a COM object. Once that you added a reference to the Exontrol's ExComboBox the EXCOMBOBOXLib namespace is created. The EXCOMBOBOXLib namespace contains definitions for all objects that ExComboBox control exports.

The following VFP sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:

*** ActiveX Control Event ***
LPARAMETERS object, ev, closeeditor, node

If (ev.Name = "Change") Then
    node.Value = object.Select(0)
    closeeditor = .t.
else
	If (ev.Name = "KeyPress") Then
	    local l
	    l = Ev(0).Value
	    If l = 27 Then
	        closeeditor = .t.
	    EndIf
	EndIf
EndIf

the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ):

With thisform.XMLGrid1.Editors
    With .Add("excombobox", 16) && UserEditorType
        .UserEditor("Exontrol.ComboBox", "")
        With .UserEditorObject
            .BeginUpdate
            .LabelHeight = thisform.XMLGrid1.NodeHeight - 3
            .LinesAtRoot = -1
            .HeightList(0) = 256
            .WidthList(0) =256
            .IntegralHeight = .t.
            .Columns.Add ("Name")
            .Columns.Add ("Value")
            .ColumnAutoResize = .t.
            With .Items
                .DefaultItem = .AddItem("Item 1")
                h = .DefaultItem
                .CellCaption(0, 1) = "Item 1.2"
                .DefaultItem = .InsertItem(h, , "SubItem 1")
                .CellCaption(0, 1) = "SubItem 1.2"
				.DefaultItem = .InsertItem(h, , "SubItem 2")
                .CellCaption(0, 1) = "SubItem 2.2"
                .DefaultItem = h
                .ExpandItem(0) = .t.
            EndWith
            .EndUpdate
        EndWith
    EndWith
EndWith