Occurs after data in the current cell is edited.
Type | Description | |||
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 tree control is True. Use the Edit method to programmatically edits a cell. The user must handle the AfterCellEdit event else 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 canceled the edit operation using BeforeCellEdit event. The CancelCellEdit event occurs if the user cancels the edit operation. The CancelCellEdit event is fired when the user presses ESC key while editing or when the user clicks outside the edit field.
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 |
private void AfterCellEdit(object sender, AxEXTREELib._ITreeEvents_AfterCellEditEvent e) { } void OnAfterCellEdit(long Item,long ColIndex,LPCTSTR NewCaption) { } void __fastcall AfterCellEdit(TObject *Sender,Extreelib_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: AxEXTREELib._ITreeEvents_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 AxEXTREELib._ITreeEvents_AfterCellEditEvent) Handles AfterCellEdit End Sub Private Sub AfterCellEdit(ByVal Item As EXTREELibCtl.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(oTree,Item,ColIndex,NewCaption) RETURN |
<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.Tree.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 Tree1_AfterCellEdit(ByVal Item As EXTREELibCtl.HITEM, ByVal ColIndex As Long, ByVal NewCaption As String) Tree1.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 Tree1_BeforeCellEdit(ByVal Item As EXTREELibCtl.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 AxTree1_AfterCellEdit(ByVal sender As Object, ByVal e As AxEXTREELib._ITreeEvents_AfterCellEditEvent) Handles AxTree1.AfterCellEdit AxTree1.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 axTree1_AfterCellEdit(object sender, AxEXTREELib._ITreeEvents_AfterCellEditEvent e) { axTree1.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 OnAfterCellEditTree1(long Item, long ColIndex, LPCTSTR NewCaption) { m_tree.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.Tree1.Items .DefaultItem = item .CellCaption( 0, colindex ) = newcaption endwith