ComponentOne True DBGrid Pro 8
BeforeInsert Event

 

Object Reference> True DBGrid Events> BeforeInsert Event

BeforeInsert Event

The BeforeInsert event occurs before a new record is added from the grid.

Syntax

TDBGrid_BeforeInsert (Cancel As Integer)

Arguments

Cancel is an integer that may be set to True to prevent the insertion from occurring.

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 your application a chance to override the user's action.

If your event procedure sets the Cancel argument 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 fired.

See Also

TDBGrid Control

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback