GrapeCity.Xaml.SpreadSheet.UI
DataValidationResult Enumeration
Example Example 


GrapeCity.Xaml.SpreadSheet.UI.UndoRedo Namespace : DataValidationResult Enumeration
Represents a data validation result when a cell sets a data validator object.
Syntax
'Declaration
 
Public Enum DataValidationResult 
   Inherits System.Enum
'Usage
 
Dim instance As DataValidationResult
public enum DataValidationResult : System.Enum 
Members
MemberDescription
Discard Indicates to discard the value and not apply it to the cell for a validation error.
ForceApply Indicates to apply the value to a cell for a validation error.
Retry Indicates to retry many times to apply the value to the cell for a validation error.
Example
This example uses the DataValidationResult enumeration.
gcSpreadSheet1.ActiveSheet[1, 1, 3, 3].DataValidator = GrapeCity.Xaml.SpreadSheet.Data.DataValidator.CreateTextLengthValidator(GrapeCity.Xaml.SpreadSheet.Data.ComparisonOperator.Between, 3, 5);

private void gcSpreadSheet1_ValidationError(object sender, GrapeCity.Xaml.SpreadSheet.UI.ValidationErrorEventArgs e)
        {
            listBox1.Items.Add(e.Column.ToString());
            listBox1.Items.Add(e.Row.ToString());
            listBox1.Items.Add(e.ValidationResult.ToString());
            listBox1.Items.Add(e.Validator.ToString());
            e.ValidationResult = GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.DataValidationResult.Discard;
        }

        private void gcSpreadSheet1_ValueChanged(object sender, GrapeCity.Xaml.SpreadSheet.UI.CellEventArgs e)
        {
            listBox1.Items.Add(e.Column.ToString());
            listBox1.Items.Add(e.Row.ToString());
        }
GcSpreadSheet1.ActiveSheet(1, 1, 3, 3).DataValidator = GrapeCity.Xaml.SpreadSheet.Data.DataValidator.CreateTextLengthValidator(GrapeCity.Xaml.SpreadSheet.Data.ComparisonOperator.Between, 3, 5)

Private Sub GcSpreadSheet1_ValidationError(sender As Object, e As GrapeCity.Xaml.SpreadSheet.UI.ValidationErrorEventArgs) Handles GcSpreadSheet1.ValidationError
        ListBox1.Items.Add(e.Column.ToString())
        ListBox1.Items.Add(e.Row.ToString())
        ListBox1.Items.Add(e.ValidationResult.ToString())
        ListBox1.Items.Add(e.Validator.ToString())
        e.ValidationResult = GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.DataValidationResult.Discard
    End Sub

Private Sub GcSpreadSheet1_ValueChanged(sender As Object, e As GrapeCity.Xaml.SpreadSheet.UI.CellEventArgs) Handles GcSpreadSheet1.ValueChanged
        ListBox1.Items.Add(e.Column.ToString())
        ListBox1.Items.Add(e.Row.ToString())
    End Sub
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.DataValidationResult

See Also

Reference

GrapeCity.Xaml.SpreadSheet.UI.UndoRedo Namespace