GrapeCity.Xaml.SpreadSheet.UI
ValidationPasting Event (GcSpreadSheet)
Example 


GrapeCity.Xaml.SpreadSheet.UI Namespace > GcSpreadSheet Class : ValidationPasting Event
Occurs when a validator is being pasted.
Syntax
'Declaration
 
Public Event ValidationPasting As EventHandler(Of ValidationPastingEventArgs)
'Usage
 
Dim instance As GcSpreadSheet
Dim handler As EventHandler(Of ValidationPastingEventArgs)
 
AddHandler instance.ValidationPasting, handler
public event EventHandler<ValidationPastingEventArgs> ValidationPasting
Event Data

The event handler receives an argument of type ValidationPastingEventArgs containing data related to this event. The following ValidationPastingEventArgs properties provide information specific to this event.

PropertyDescription
Gets the source range.  
Gets the source sheet.  
Gets or sets whether the event is handled.  
Gets or sets the invalid message.  
Gets a value that indicates whether the data is cut.  
Gets or sets whether the value is invalid.  
Gets the pasting range.  
Gets the cell range when pasting.  
Gets the worksheet.  
Example
Copy and paste the validator in cell (1,1) to see the event code.
private void Grid_Loaded_1(object sender, RoutedEventArgs e)
        {
            var valid1 = GrapeCity.Xaml.SpreadSheet.Data.DataValidator.CreateNumberValidator(GrapeCity.Xaml.SpreadSheet.Data.ComparisonOperator.GreaterThan, "5", "20", true);
            GcSpreadSheet1.Sheets[0].Cells[1, 1].DataValidator = valid1;
            GcSpreadSheet1.Sheets[0].Cells[1, 0].Text = "A number greater than 5 is valid.";
        }

        private void GcSpreadSheet1_ValidationPasting(object sender, GrapeCity.Xaml.SpreadSheet.UI.ValidationPastingEventArgs e)
        {
            TextBox1.Text = e.IsInvalid.ToString();
        }

        private void GcSpreadSheet1_ValidationDragDropBlock(object sender, GrapeCity.Xaml.SpreadSheet.UI.ValidationDragDropBlockEventArgs e)
        {
            TextBox1.Text = e.RowCount.ToString();
        }
Dim valid1 = GrapeCity.Xaml.SpreadSheet.Data.DataValidator.CreateNumberValidator(GrapeCity.Xaml.SpreadSheet.Data.ComparisonOperator.GreaterThan, "5", "20", True)
GcSpreadSheet1.Sheets(0).Cells(1, 1).DataValidator = valid1
GcSpreadSheet1.Sheets(0).Cells(1, 0).Text = "A number greater than 5 is valid."

Private Sub GcSpreadSheet1_ValidationPasting(sender As Object, e As GrapeCity.Xaml.SpreadSheet.UI.ValidationPastingEventArgs) Handles GcSpreadSheet1.ValidationPasting
TextBox1.Text = e.IsInvalid.ToString()
End Sub

Private Sub GcSpreadSheet1_ValidationDragDropBlock(sender As Object, e As GrapeCity.Xaml.SpreadSheet.UI.ValidationDragDropBlockEventArgs) Handles GcSpreadSheet1.ValidationDragDropBlock
TextBox1.Text = e.RowCount.ToString()
End Sub
See Also