Skip to content

CanDeleteRow - cCJGrid

Called before any row delete. Returns True if the SelectedRow can be deleted.

Type: Function
Return Data Type: Boolean

Syntax

Function CanDeleteRow Returns Boolean

Call Example

Get CanDeleteRow to BooleanVariable

Description

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

This function returns false if pbAllowDeleteRow is false or if pbReadOnly is True. In addition, when CanDeleteRow is called, it calls CanDeleteRow in the datasource object. This allows the datasource object to control if a row can be deleted. For example, if the cDbCJGridDataSource object's DataDictionary cannot delete the record, it will not allow the deletion.

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

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

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

Return Value

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