Occurs after a row has been deleted.
[Visual Basic]
Public Event AfterDelete As EventHandler
[C#]
public event EventHandler AfterDelete
[Delphi]
public property AfterDelete: EventHandler read remove_AfterDelete write add_AfterDelete;
Remarks
When the user selects a record selector in the grid and presses DEL or CTRL+X, the BeforeDelete event is executed, and unless canceled, the row is deleted. Once the row is deleted, the AfterDelete event is executed.
While the AfterDelete event procedure is executing, the bookmark of the deleted row is available in the collection provided by the SelectedRows property.
The AfterDelete event cannot be canceled.
Example
The following code uses the AfterDelete event to show the message "The row has been deleted." after a row is deleted:
Private Sub C1TrueDBGrid1_AfterDelete(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles C1TrueDBGrid1.AfterDelete
MessageBox.Show("The row has been deleted.", "C1TrueDBGrid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Sub
· C#
private void c1TrueDBGrid1_AfterDelete(object sender, EventArgs e)
{
MessageBox.Show("The row has been deleted.", "C1TrueDBGrid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
· Delphi
procedure C1TrueDBGrid1_AfterDelete(sender: System.Object; e: EventArgs);
begin
MessageBox.Show('The row has been deleted.', 'C1TrueDBGrid', MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
end;
Note: The AllowDelete property must be set to True.
See Also
C1TrueDBGrid Class | C1TrueDBGrid Members | C1.Win.C1TrueDBGrid Namespace
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |