Skip to content

CanAddRow - cCJGridDataSource

Returns True if the datasource object supports adding rows

Type: Function
Return Data Type: Boolean

Syntax

Function CanAddRow Returns Boolean

Call Example

Get CanAddRow to BooleanVariable

Description

Before a grid will attempt to add (insert or append) a new row it checks to see if adding rows is supported. It does this by sending the message cCJGrid.CanAddRow to itself. The CanAddRow message in the grid class sends the message CanAddRow to its datasource object. This allows both the grid and the grid's datasource to determine if a row can be added.

cCJGrid / cCJGridDataSource

This always returns True.

cDbCJGrid / cDbCJGridDataSource

This returns True if the datasource's DataDictionary property Read_Only_State is False.

Normally, the ability to add rows is managed at the grid level with CanAddRow, pbAllowInsertRow, pbAllowAppendRow and pbReadOnly.

You will never send this message and you would only augment it if you were creating your own datasource class. Even then, you are not likely to use it.

Return Value

True if the datasource supports adding rows.