Represents the method that will handle the OnRowChanging, OnRowChanged, OnRowDeleting, and OnRowDeleted events of a DataTable.
[Visual Basic] Public Delegate Sub DataRowChangeEventHandler( _ ByVal sender As Object, _ ByVal e As DataRowChangeEventArgs _ ) [C#] public delegate void DataRowChangeEventHandler( object sender, DataRowChangeEventArgs e ); [C++] public __gc __delegate void DataRowChangeEventHandler( Object* sender, DataRowChangeEventArgs* e );
[JScript] In JScript, you can use the delegates in the NGWS frameworks, but you cannot define your own.
The declaration of your event-handling method must have the same parameters as the DataRowChangeEventHandler delegate declaration.
When you create a DataRowChangeEventHandler delegate, you identify the method that will handle the vent. To associate the event with your event-handling method, add an instance of the delegate to the event. The event-handling method is called whenever the event occurs, until you remove the delegate. For more information about delegates, see <DelegateTopicTBD>.
Namespace: System.Data
Assembly: System.Data.dll
The following example adds a DataRowChangeEventHandler and the procedure to handle the event when a row is changed. The procedure prints the action and value of the changed row.
[Visual Basic]
Private myTable As DataTable Private Sub AddHandler() Set myTable = datagrid1.DataGridTable.DataTable myTable.AddOnRowChanged New System.Data.DataRowChangeEventHandler(AddressOf Me.myDataTable_Changed) End Sub Private Sub myDataTable_Changed(ByVal sender As System.Object, ByVal e As System.Data.DataRowChangeEventArgs) Debug.Print "Row Changed", e.Action, e.Row.Item(datagrid1.CurrentCell.ColumnNumber) End Sub
System.Data Namespace | DataRow | DataTable | DataRowChangeEventArgs