event AfterCellEdit (ItemIndex as Long, ColIndex as Long, NewCaption as String)
Occurs after data in the current cell is edited.

 TypeDescription 
   ItemIndex as Long A long expression that indicates the index of item being edited.  
   ColIndex as Long A long expression that indicates the column's index   
   NewCaption as String A string expression that indicates the text being edited   

Use the AfterCellEdit event to change the cell's caption after the edit operation ends. The control fires BeforeCellEdit event and AfterCellEdit events if the AllowEdit property is True. The AfterCellEdit event notifies your application that the user alters the cell's caption. Use the Edit method to edit programmatically a cell.  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 ItemIndex,int ColIndex,string NewCaption)
{
}

Private Sub AfterCellEdit(ByVal sender As System.Object,ByVal ItemIndex 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, AxEXLISTLib._IListEvents_AfterCellEditEvent e)
{
}

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

void __fastcall AfterCellEdit(TObject *Sender,long ItemIndex,long ColIndex,BSTR NewCaption)
{
}

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

procedure AfterCellEdit(sender: System.Object; e: AxEXLISTLib._IListEvents_AfterCellEditEvent);
begin
end;

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

Private Sub AfterCellEdit(ByVal sender As System.Object, ByVal e As AxEXLISTLib._IListEvents_AfterCellEditEvent) Handles AfterCellEdit
End Sub

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

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

LPARAMETERS ItemIndex,ColIndex,NewCaption

PROCEDURE OnAfterCellEdit(oList,ItemIndex,ColIndex,NewCaption)
RETURN

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

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

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

Procedure OnComAfterCellEdit Integer llItemIndex Integer llColIndex String llNewCaption
	Forward Send OnComAfterCellEdit llItemIndex llColIndex llNewCaption
End_Procedure

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

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

function AfterCellEdit as v (ItemIndex as N,ColIndex as N,NewCaption as C)
end function

function nativeObject_AfterCellEdit(ItemIndex,ColIndex,NewCaption)
return

The following VB sample change the cell's caption when the user hits the ENTER key: 

Private Sub List1_AfterCellEdit(ByVal Index As Long, ByVal ColIndex As Long, ByVal NewCaption As String)
    Debug.Print NewCaption
    With List1.Items
        .Caption(Index, ColIndex) = NewCaption
    End With
End Sub

The following C++ sample change the cell's caption when the user hits the ENTER key:

void OnAfterCellEditList1(long ItemIndex, long ColIndex, LPCTSTR NewCaption) 
{
	CItems items = m_list.GetItems();
	items.SetCaption( ItemIndex, COleVariant( ColIndex ), COleVariant( NewCaption ) );
}

The following VB.NET sample change the cell's caption when the user hits the ENTER key:

Private Sub AxList1_AfterCellEdit(ByVal sender As Object, ByVal e As AxEXLISTLib._IListEvents_AfterCellEditEvent) Handles AxList1.AfterCellEdit
    With AxList1.Items
        .Caption(e.itemIndex, e.colIndex) = e.newCaption
    End With
End Sub

The following C# sample change the cell's caption when the user hits the ENTER key:

private void axList1_AfterCellEdit(object sender, AxEXLISTLib._IListEvents_AfterCellEditEvent e)
{
	axList1.Items.set_Caption(e.itemIndex, e.colIndex, e.newCaption);
}

The following VFP sample change the cell's caption when the user hits the ENTER key:

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

with thisform.List1.Items
	.Caption( itemIndex, colindex) = newcaption
endwith

 


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.