'Declaration Public Event ValidationDragDropBlock As EventHandler(Of ValidationDragDropBlockEventArgs)
'Usage Dim instance As GcSpreadSheet Dim handler As EventHandler(Of ValidationDragDropBlockEventArgs) AddHandler instance.ValidationDragDropBlock, handler
public event EventHandler<ValidationDragDropBlockEventArgs> ValidationDragDropBlock
Event Data
The event handler receives an argument of type ValidationDragDropBlockEventArgs containing data related to this event. The following ValidationDragDropBlockEventArgs properties provide information specific to this event.
Property | Description |
---|---|
ColumnCount | Gets the column count of the cell range being dragged. |
Copy | Gets whether the source range is copied. |
FromColumn | Gets the column index of the top left cell of the source range (range being dragged). |
FromRow | Gets the row index of the top left cell of the source range (range being dragged). |
Handle | Gets or sets whether the event is handled. |
Insert | Gets whether the source range is inserted. |
InvalidMessage | Gets or sets the invalid message. |
IsInvalid | Gets or sets whether the value is valid. |
RowCount | Gets the row count of the cell range being dragged. |
ToColumn | Gets the column index of the bottom right cell of the destination range (where selection is dropped). |
ToRow | Gets the row index of the top left cell of the destination range (where selection is dropped). |
Example
This example uses the ValidationDragDropBlock event. Drag and move 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