Skip to content

CanSaveRow - cCJGrid

Called before any row save. Returns True if the SelectedRow can be saved.

Type: Function
Return Data Type: Boolean

Syntax

Function CanSaveRow Returns Boolean

Call Example

Get CanSaveRow to BooleanVariable

Description

The CanSaveRow function is called before a row is about to be saved. If the function returns False, the row will not be saved.

This function returns False if pbReadOnly is True. In addition, when CanSaveRow is called, it calls CanSaveRow in the data source object. This allows the datasource object to control if a row can be saved. For example, if the cDbCJGridDataSource object's DataDictionary cannot save the record, it will not allow the save.

Augmenting CanSaveRow can be particularly useful to control row saves based on the current condition of your view or your data.

Returning True from this function does not mean that a save is required and it does not mean that the save is valid and will proceed. It only means that the save process is allowed. This process may include verifications and validations that will cancel the save.

User interface actions, such as message boxes, may not be used in this function.

Return Value

Returns True if the SelectedRow can be saved. . If the function returns False, the row will not be saved.