event AfterCellEdit (Item as HITEM, ColIndex as Long, NewCaption as String)

Occurs after data in the current cell is edited.

TypeDescription
Item as HITEM A long expression that indicates the handle of the item being changed.
ColIndex as Long A long expression that specifies the index of the column where the change occurs, or a handle to a cell being edited if the Item parameter is 0.
NewCaption as String A string expression that indicates the newly cell's caption.

The AfterCellEdit and BeforeCellEdit events are fired only if the AllowEdit property of the control is True. Use the Edit method to programmatically edits a cell. If the user doesn't handle the AfterCellEdit event the cell's caption remains unchanged. Use the AfterCellEdit event to change the cell's caption after user edits a cell. The AfterCellEdit event is not fired if the user has canceled the edit operation using BeforeCellEdit event. 

Syntax for AfterCellEdit event, /NET version, on:

private void AfterCellEdit(object sender,int Item,int ColIndex,string NewCaption)
{
}

Private Sub AfterCellEdit(ByVal sender As System.Object,ByVal Item As Integer,ByVal ColIndex As Integer,ByVal NewCaption As String) Handles AfterCellEdit
End Sub

Syntax for AfterCellEdit event, /COM version, on:

private void AfterCellEdit(object sender, AxEXGANTTLib._IGanttEvents_AfterCellEditEvent e)
{
}

void OnAfterCellEdit(long Item,long ColIndex,LPCTSTR NewCaption)
{
}

void __fastcall AfterCellEdit(TObject *Sender,Exganttlib_tlb::HITEM Item,long ColIndex,BSTR NewCaption)
{
}

procedure AfterCellEdit(ASender: TObject; Item : HITEM;ColIndex : Integer;NewCaption : WideString);
begin
end;

procedure AfterCellEdit(sender: System.Object; e: AxEXGANTTLib._IGanttEvents_AfterCellEditEvent);
begin
end;

begin event AfterCellEdit(long Item,long ColIndex,string NewCaption)
end event AfterCellEdit

Private Sub AfterCellEdit(ByVal sender As System.Object, ByVal e As AxEXGANTTLib._IGanttEvents_AfterCellEditEvent) Handles AfterCellEdit
End Sub

Private Sub AfterCellEdit(ByVal Item As EXGANTTLibCtl.HITEM,ByVal ColIndex As Long,ByVal NewCaption As String)
End Sub

Private Sub AfterCellEdit(ByVal Item As Long,ByVal ColIndex As Long,ByVal NewCaption As String)
End Sub

LPARAMETERS Item,ColIndex,NewCaption

PROCEDURE OnAfterCellEdit(oGantt,Item,ColIndex,NewCaption)
RETURN

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

<SCRIPT EVENT="AfterCellEdit(Item,ColIndex,NewCaption)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function AfterCellEdit(Item,ColIndex,NewCaption)
End Function
</SCRIPT>

Procedure OnComAfterCellEdit HITEM llItem Integer llColIndex String llNewCaption
	Forward Send OnComAfterCellEdit llItem llColIndex llNewCaption
End_Procedure

METHOD OCX_AfterCellEdit(Item,ColIndex,NewCaption) CLASS MainDialog
RETURN NIL

void onEvent_AfterCellEdit(int _Item,int _ColIndex,str _NewCaption)
{
}

function AfterCellEdit as v (Item as OLE::Exontrol.Gantt.1::HITEM,ColIndex as N,NewCaption as C)
end function

function nativeObject_AfterCellEdit(Item,ColIndex,NewCaption)
return

The following VB sample changes the cell's caption as soon as the edit operation ends.

Private Sub Gantt1_AfterCellEdit(ByVal Item As EXGANTTLibCtl.HITEM, ByVal ColIndex As Long, ByVal NewCaption As String)
    Gantt1.Items.CellCaption(Item, ColIndex) = NewCaption
End Sub

Use the BeforeCellEdit is you need to cancel editing cells. The following VB sample cancels editing of any cell that' shoted by the first column:

Private Sub Gantt1_BeforeCellEdit(ByVal Item As EXGANTTLibCtl.HITEM, ByVal ColIndex As Long, Value As Variant, Cancel As Variant)
    Cancel = ColIndex = 0
End Sub

The following VB.NET sample changes the cell's caption as soon as the edit operation ends.

Private Sub AxGantt1_AfterCellEdit(ByVal sender As Object, ByVal e As AxEXGANTTLib._IGanttEvents_AfterCellEditEvent) Handles AxGantt1.AfterCellEdit
    AxGantt1.Items.CellCaption(e.item, e.colIndex) = e.newCaption
End Sub

The following C# sample changes the cell's caption as soon as the edit operation ends.

private void axGantt1_AfterCellEdit(object sender, AxEXGANTTLib._IGanttEvents_AfterCellEditEvent e)
{
	axGantt1.Items.set_CellCaption( e.item, e.colIndex, e.newCaption );
}

The following C++ sample changes the cell's caption as soon as the edit operation ends.

void OnAfterCellEditGantt1(long Item, long ColIndex, LPCTSTR NewCaption) 
{
	m_gantt.GetItems().SetCellCaption( COleVariant( Item ), COleVariant( ColIndex ), COleVariant( NewCaption ) );
}

The following VFP sample changes the cell's caption as soon as the edit operation ends.

*** ActiveX Control Event ***
LPARAMETERS item, colindex, newcaption

with thisform.Gantt1.Items
	.DefaultItem = item
	.CellCaption( 0, colindex ) = newcaption
endwith