Spread Silverlight Documentation
ValidationPasting Event (GcSpreadSheet)
Example 


Occurs when a validator is being pasted.
Syntax
'Declaration
 
Public Event ValidationPasting As System.EventHandler(Of ValidationPastingEventArgs)
'Usage
 
Dim instance As GcSpreadSheet
Dim handler As System.EventHandler(Of ValidationPastingEventArgs)
 
AddHandler instance.ValidationPasting, handler
public event System.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
FromRangeGets the source range.  
FromSheetGets the source sheet.  
HandleGets or sets whether the event is handled.  
InvalidMessageGets or sets the invalid message.  
IsCuttingGets a value that indicates whether the data is cut.  
IsInvalidGets or sets whether the value is invalid.  
PastingRangeGets the pasting range.  
ToRangeGets the cell range when pasting.  
ToWorksheetGets the worksheet.  
Example
Copy and paste the validator in cell (1,1) to see the event code.
var valid1 = GrapeCity.Windows.SpreadSheet.Data.DataValidator.CreateNumberValidator(GrapeCity.Windows.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.Windows.SpreadSheet.UI.ValidationPastingEventArgs e)
        {
            TextBox1.Text = e.IsInvalid.ToString();
        }

private void GcSpreadSheet1_ValidationDragDropBlock(object sender, GrapeCity.Windows.SpreadSheet.UI.ValidationDragDropBlockEventArgs e)
        {
            TextBox1.Text = e.RowCount.ToString();
        }
Dim valid1 = GrapeCity.Windows.SpreadSheet.Data.DataValidator.CreateNumberValidator(GrapeCity.Windows.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.Windows.SpreadSheet.UI.ValidationPastingEventArgs) Handles GcSpreadSheet1.ValidationPasting
            TextBox1.Text = e.IsInvalid.ToString()
    End Sub

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

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

GcSpreadSheet Class
GcSpreadSheet Members

 

 


Copyright © GrapeCity, inc. All rights reserved.