SSpread.AfterLeaveRow Event
Occurs after moving to another row with the OperationMode property $OperationModeRow (row mode).
The following child objects are attached to the Event object.
| Type | Name | Description |
|---|---|---|
| Number | Row | Line number before moving |
| Number | RowWasLast | $TRUE if the previous row is after the last row where the value is entered, $FALSE otherwise |
| Number | RowChanged | $TRUE if the row value changes, $FALSE otherwise |
| Number | AllCellsHaveData | $TRUE if all cells in the row are filled with values, $FALSE otherwise |
| Number | NewRow | Destination row number |
| Number | NewRowIsLast | $TRUE if the destination row is after the last row where the value is entered, $FALSE otherwise |
The EnterRow event is fired at the beginning of the row edit state.
If you move cells in the same row, the LeaveCell and AfterLeaveCell events will occur.
If you move from the script, the event will not fire.
Added since Ver.5.0.2
Example of usage
MaxCols = 5;
OperationMode = $OperationModeRow;
Function OnAfterLeaveRow(e) {
Col = -1;
Row = e.Row;
BackColor = $STD;
Row = e.NewRow;
if (e.NewRowIsLast == $TRUE) {
BackColor = $FFCCCC;
} else {
BackColor = $CCCCFF;
}
if (e.RowChanged == $TRUE) {
Col = 0;
Row = e.Row;
if (e.AllCellsHaveData == $TRUE) {
FontBold = $TRUE;
} else {
FontBold = $FALSE;
}
Col = -1;
Row = e.Row;
if (e.RowWasLast == $TRUE) {
ForeColor = $RED;
} else {
ForeColor = $BLUE;
}
}
}
Related Item
OperationMode property
EnterRow, LeaveRow event