AddRow - cCJGrid
Adds a new row to the grid at the requested row offset
Type: Function
Return Data Type: Boolean
Parameters
| Parameter | Type | Description |
|---|---|---|
| iNewRow | Integer | Row number to insert empty row into. If less than the number of rows, this is an insert, else it is an append |
Syntax
Function AddRow Integer iNewRow Returns Boolean
Call Example
Get AddRow iNewRow to BooleanVariable
Description
AddRow adds a new blank row to your grid at the passed row position. Normally, rows are added with Request_InsertRow or Request_AppendRow, which call AddRow. Therefore, you will not usually send this message.
AddRow will add a row only if: 1. The SelectedRow can be exited. If the SelectedRow is changed or new, the existing row must be saved or cleared. If this process fails or is canceled, the append request is halted. 2. The grid allows you to append rows. CanAddRow is called and it must return True. CanAddRow will return False if the grid is read-only (pbReadOnly) or if the datasource does not allow adding rows.
AddRow sets the SelectedRow to -1, meaning that there is no SelectedRow. It is your responsibility to set the SelectedRow and SelectedColumn as needed. You do this using messages line MoveToRow and MoveToFirstEnterableColumn. If you use Request_InsertRow or Request_AppendRow, the selected row and column is set for you. AddRow is considered to be a lower level method and should only be used with care.
Return Value
False the row was added, True if the row could not be added.