Spread Windows Forms 11.0 Product Documentation
DoActionReason Property (ValueProcess)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > ValueProcess Class : DoActionReason Property
Gets or sets the reasons which can cause a ValidateActionBase to execute.
Syntax
'Declaration
 
Public Shadows Property DoActionReason As ValidateReasons
'Usage
 
Dim instance As ValueProcess
Dim value As ValidateReasons
 
instance.DoActionReason = value
 
value = instance.DoActionReason
public new ValidateReasons DoActionReason {get; set;}

Property Value

A bitwise combination of the ValidateReasons. The default is ValidateReasons.CellValidating.
Exceptions
ExceptionDescription
The assigned value is not a valid ValidateReasons value.
The assigned value is not ValidateReasons.CellValidating, ValidateReasons.EndEdit, or ValidateReasons.CellValidating |ValidateReasons.EndEdit.
Example
This example creates a text validator.
//Typing a value outside the range clears the value when leaving the cell
FarPoint.Win.Spread.ValueProcess cnotify = new FarPoint.Win.Spread.ValueProcess();
cnotify.ValueProcessOption = FarPoint.Win.Spread.ValueProcessOption.Clear;
cnotify.DoActionReason = FarPoint.Win.Spread.ValidateReasons.EndEdit;
FarPoint.Win.Spread.TextLengthValidator tvalid = new FarPoint.Win.Spread.TextLengthValidator();
tvalid.LengthUnit = FarPoint.Win.Spread.LengthUnit.Char;
tvalid.MaximumLength = 6;
tvalid.MinimumLength = 0;
tvalid.Actions.Add(cnotify);
fpSpread1.Sheets[0].AddValidators(new FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), tvalid);
'Typing a value outside the range clears the value when leaving the cell
Dim cnotify As New FarPoint.Win.Spread.ValueProcess()
cnotify.ValueProcessOption = FarPoint.Win.Spread.ValueProcessOption.Clear
cnotify.DoActionReason = FarPoint.Win.Spread.ValidateReasons.EndEdit
Dim tvalid As New FarPoint.Win.Spread.TextLengthValidator()
tvalid.LengthUnit = FarPoint.Win.Spread.LengthUnit.Char
tvalid.MaximumLength = 6
tvalid.MinimumLength = 0
tvalid.Actions.Add(cnotify)
FpSpread1.Sheets(0).AddValidators(New FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), tvalid)
See Also

Reference

ValueProcess Class
ValueProcess Members