Action Property

Specifies whether to continue with remaining cells, stop or revert the cells modified so far. Default is ClearCellAndContinue, unless explicitly stated otherwise in the remarks section below. Note that this property is honored only if the error occurs with a particular cell. If the error is with the whole operation, then this property has no effect.
Public Property Action As MultiCellOperationErrorInfo.ErrorAction
public MultiCellOperationErrorInfo.ErrorAction Action {get; set;}

During the process of performing multi-cell operations, a cell can have an error. For example, when pasting values to cells, a cell might not accept the value being pasted to it because it's the wrong data type, or it doesn't satisfy the column constraints. In that case the UltraGrid.Error event will be generated. In such a case you can choose to take one of the actions listed in the MultiCellOperationErrorInfo.ErrorAction enum. You can get the cell that had the error using the ErrorCell property. Also note that you can use the UltraGrid.BeforeMultiCellOperation event to perform custom conversions of values being copied or pasted.

If however the Error event is fired in response to an error that is not associated with a specific cell, then this property has no effect. For example, when pasting, if the number of cells available for pasting is smaller than the number of cells being pasted, then the Error event will be fired. However such an error is not associated with a specific cell, but rather it applies to the whole operation. In such a case this property won't be honored since the whole operations can't be performed. Note that in such a scenario, none of the cells will be modified.

Note: If you want to prevent the UltraGrid from displaying an error message, set the Cancel to true on the ErrorEventArgs. Alternatively you can also set the ErrorEventArgs.ErrorText to null or empty string to prevent the UltraGrid from displaying the error dialog. This lets you display a custom error message box.

The default value of this property is ClearCellAndContinue except for read-only cells in which case the default value is Continue since the values of read-only cells can not be cleared.


Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also