This documentation is archived and is not being maintained.

_DataDOMEventSink_Event.OnAfterChange Event (Microsoft.Office.Interop.InfoPath.SemiTrust)

Occurs after changes to a form's underlying XML document have been accepted and after the OnValidate event has occurred.

Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in microsoft.office.interop.infopath.semitrust.dll)

event _DataDOMEventSink_OnAfterChangeEventHandler OnAfterChange

This event handler does not allow users to cancel an operation.

The OnAfterChange event is typically used for changing data in a form after other changes have occurred — for example, making calculations or changing the structure of a form's underlying XML document.

NoteNote:

In some cases, events related to changes in a form's underlying XML document may occur more than once. For example, when existing data is changed, an insert and delete operation occurs.

[InfoPathEventHandler(MatchPath="/my:myFields/my:field1", EventType=InfoPathEventType.OnAfterChange)]
public void field1_OnAfterChange(DataDOMEvent e)
{
 if (e.IsUndoRedo)
 {
  // An undo or redo operation has occurred and the DOM is read-only.
  return;
 }

 CalculateTotalCampaignCost();
}
Show: