event EditClose ()
Occurs when the edit operation ends.

TypeDescription
Use the EditClose event to notify your application that the editor is closed. The EditClose event is fired when the focused cell ends editing. Use the FocusItem property to determine the handle of the item where the edit operation ends. Use the FocusColumnIndex property to determine the index of the column where the edit operation ends. The Editing specifies the window's handle of the built-in editor while the control is running in edit mode. The EditingText property returns the caption being shown on the editor while the control runs in edit mode. Use the EditClose method to closes the current editor, by code.  For instance, the EditClose event is not fired when user hides the drop down portion of the editor. Use the Edit event to prevent editing a cell.

The following edit-related events are triggered in this sequence:

  1. Edit event, This event is raised before the editing process begins. It allows you to prevent the cell from being edited by setting the Cancel parameter to True.
  2. EditOpen event, Triggered once the editing process starts and the editor is displayed. The Editing property returns the handle of the internal editor window being used.
  3. Change event, Fired just before the cell's content is about to change. The NewValue parameter contains the new value that will be assigned to the cell, while the CellValue property holds the current value. If the control is linked to a database, note that the corresponding database field remains unchanged at the time the Change event is triggered.
  4. Changed event, Occurs after the user has successfully changed the content of the cell. The CellValue property now reflects the updated value. If the control is linked to a database, the corresponding field is updated, so the new value is available during the Changed event.
  5. EditClose event, Raised when the cell editor is closed and no longer visible.

Syntax for EditClose event, /NET version, on:

private void EditCloseEvent(object sender)
{
}

Private Sub EditCloseEvent(ByVal sender As System.Object) Handles EditCloseEvent
End Sub

Syntax for EditClose event, /COM version, on:

private void EditCloseEvent(object sender, EventArgs e)
{
}

void OnEditClose()
{
}

void __fastcall EditClose(TObject *Sender)
{
}

procedure EditClose(ASender: TObject; );
begin
end;

procedure EditCloseEvent(sender: System.Object; e: System.EventArgs);
begin
end;

begin event EditClose()
end event EditClose

Private Sub EditCloseEvent(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditCloseEvent
End Sub

Private Sub EditClose()
End Sub

Private Sub EditClose()
End Sub

LPARAMETERS nop

PROCEDURE OnEditClose(oG2antt)
RETURN

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

<SCRIPT EVENT="EditClose()" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function EditClose()
End Function
</SCRIPT>

Procedure OnComEditClose 
	Forward Send OnComEditClose 
End_Procedure

METHOD OCX_EditClose() CLASS MainDialog
RETURN NIL

void onEvent_EditClose()
{
}

function EditClose as v ()
end function

function nativeObject_EditClose()
return

The following VB sample displays the window's handle of the built-in editor being closed:

Private Sub G2antt1_EditClose()
    Debug.Print "EditClose " & G2antt1.Editing
End Sub

The following VB sample displays the caption of the cell where the edit operation ends:

Private Sub G2antt1_EditClose()
    With G2antt1.Items
        Debug.Print "EditClose on '"; .CellCaption(.FocusItem, G2antt1.FocusColumnIndex) & "'."
    End With
End Sub

The following C++ sample displays the handle of the built-in editor being closed:

#include "Items.h"
void OnEditCloseG2antt1() 
{
	CItems items = m_g2antt.GetItems();
	COleVariant vtItem( items.GetFocusItem() ), vtColumn( m_g2antt.GetFocusColumnIndex() );
	CString strFormat;
	strFormat.Format( "'%s'  %i", V2S( &items.GetCellValue( vtItem, vtColumn ) ), m_g2antt.GetEditing() );
	OutputDebugString( strFormat );
}

The following VB.NET sample displays the handle of the built-in editor being closed:

Private Sub AxG2antt1_EditCloseEvent(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxG2antt1.EditCloseEvent
    With AxG2antt1
        Debug.Print(.Items.CellValue(.Items.FocusItem, .FocusColumnIndex) & " " & .Editing.ToString())
    End With
End Sub

The following C# sample displays the handle of the built-in editor being closed:

private void axG2antt1_EditCloseEvent(object sender, EventArgs e)
{
	object cellValue = axG2antt1.Items.get_CellValue(axG2antt1.Items.FocusItem, axG2antt1.FocusColumnIndex);
	string strOutput = "'" + (cellValue != null ? cellValue.ToString() : "") + "' " + axG2antt1.Editing.ToString();
	System.Diagnostics.Debug.WriteLine( strOutput );
}

The following VFP sample displays the handle of the built-in editor being closed:

*** ActiveX Control Event ***

with thisform.G2antt1.Items
	.DefaultItem = .FocusItem()
	wait window nowait str(.CellValue( 0, thisform.G2antt1.FocusColumnIndex() ))
	wait window nowait str(thisform.G2antt1.Editing())
endwith