ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1TrueDBGrid.BeforeInsert Event

Occurs before a new row is added to the datasource.

[Visual Basic]

Public Event BeforeInsert As CancelEventHandler

[C#]

public event CancelEventHandler BeforeInsert

[Delphi]

public property BeforeInsert: CancelEventHandler read remove_BeforeInsert write add_BeforeInsert;

Remarks

When the user selects the AddNew row (the last row in the grid) and enters a character in one of the cells, the BeforeInsert event is triggered to give the application a chance to override the user's action.

If event procedure sets the CancelEventArgs.Cancel property to True, no insertion takes place and the cell is cleared. Otherwise, the AddNew row is scrolled up one line and its record selector changes to show that it has been modified. However, a new row has not yet been added to the database.

Once the user commits the new row by moving to another row within the grid, the BeforeUpdate event is triggered, followed by the AfterUpdate and AfterInsert events. If the BeforeUpdate event is canceled, then the AfterUpdate and AfterInsert events will not be raised.

See Also

C1TrueDBGrid Class | C1TrueDBGrid Members | C1.Win.C1TrueDBGrid Namespace


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.