ComponentOne DataObjects for .NET
AfterChanges Event (BaseLogic)

C1.Data.2 Assembly > C1.Data Namespace > BaseLogic Class : AfterChanges Event
Fired when all changes initiated by a field change are done and handled by the business logic code.
Syntax
'Declaration
 
Public Event AfterChanges As RowChangeEventHandler
public event RowChangeEventHandler AfterChanges
Event Data

The event handler receives an argument of type RowChangeEventArgs containing data related to this event. The following RowChangeEventArgs properties provide information specific to this event.

PropertyDescription
The action that has occurred.  
The table object where the event has occurred.  
For a deleted row, in BaseLogic.AfterDelete event, the array of field values in the row before the row was deleted. This property is not set in events other than AfterDelete. This property must be used in BaseLogic.AfterDelete event to access row values because they are not accessible through regular row properties after the row has been deleted.  
For events BaseLogic.BeforeEndEdit, BaseLogic.AfterEndEdit, this property indicates whether the row has been modified while it was in edit mode. This property is often needed in BaseLogic.BeforeEndEdit/ BaseLogic.AfterEndEdit because data-bound controls begin edit mode when they position on a row and end edit mode when they leave the row, even if no changes have been made to the row in the process.  
Parent row.  
The row where the event has occurred.  
Remarks
This event occurs when all changes to a row are finished, including both the changes made directly by the user and those resulting from executing event code that handled those changes. It is designed specifically to ensure that this is the "last change", so the developers can put code that relies on the "finality" of changes to a row. For instance, this event is the best place to put code setting calculated field values (for calculations that cannot be specified as simple calculation expressions.

When a field value in a row changes, that change can be handled by event code that in its turn can make other changes to row fields, or it could change other rows or other tables. When all such handling is done, C1DataObjects collects all changed rows and fires the AfterChanges event for every row that has changed in the process.

Setting the C1DataSet.ChangeInProgress property to True, firing AfterChanges event can be deferred until the property is set back to False. This allows multiple field changes to be performed with AfterChanges firing only once, when all changes are done.

See Also