ComponentOne True DBGrid Pro 8
ClassicAdd Event

 

ClassicAdd Event

The ClassicAdd event is fired when the user adds a new row of data to an application mode grid (one with its DataMode property set to 3 - Application).

Syntax

TDBGrid_ClassicAdd (NewRowBookmark As Variant, ByVal Col As Integer, Value As Variant)

Arguments

NewRowBookmark is a variant that must be set to a unique bookmark for subsequent references to the newly added row.

Col is an integer that identifies the column to receive the new value.

Value is a variant used to transfer the new data from the grid to the unbound data source.

Remarks

This event alerts your application that it must add a new row of data to its unbound dataset.

This event adds data one cell at a time, so it may fire multiple times in order to add data for all the columns in a row. The Col argument contains the column index corresponding to the newly entered cell data. If the user has not added data to a column, the ClassicAdd event will not fire for that column index. If you want to add a default value to a column, you can do that in the grid's BeforeUpdate event.

The Value argument contains the cell data entered by the user.

NewRowBookmark must be set to the bookmark of the newly added row, or else the user will not be able to move to another row without first canceling the new row with the Esc key. If the NewRowBookmark is set to different values when the event is called with different column indexes, the grid will use the last non Null value returned by the user.

This event will not be fired if the AllowAddNew property is set to False. Conversely, if you do not implement this event, then you must ensure that AllowAddNew is never set to True.

Note

If the add operation fails in the underlying data source, then you should set NewRowBookmark to Null.

See Also

TDBGrid Control

 

 


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

Product Support Forum  |  Documentation Feedback