Class PastingEventArgs
Provides information about the Pasting event.
Inheritance
Namespace: Syncfusion.Blazor.Spreadsheet
Assembly: Syncfusion.Blazor.Spreadsheet.dll
Syntax
public class PastingEventArgs : Object
Constructors
PastingEventArgs()
Declaration
public PastingEventArgs()
Properties
Cancel
Gets or sets a value indicating whether the paste operation should be cancelled.
Declaration
public bool Cancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | A System.Boolean indicating whether the operation should be cancelled. The default value is |
Remarks
When set to true
, the paste operation will be cancelled.
This property allows event handlers to prevent the default paste behavior.
Examples
// Cancel paste operations on protected content
void OnPasting(PastingEventArgs args)
{
if (IsProtectedContent())
{
args.Cancel = true;
}
}
CopiedRange
Gets the full address of the selected cell range, including the worksheet name, that is currently being copied or cut.
Declaration
public string CopiedRange { get; }
Property Value
Type | Description |
---|---|
System.String | A System.String in the format "SheetName!Range" (e.g., "Sheet1!A1:A10" or "Sheet2!A1") representing the source location of the copied or cut content. The default value is |
Remarks
This property contains the complete reference information of cells that are currently in the clipboard.
When content is copied from within the workbook and pasted, the CopiedRange
property will have a value.
Otherwise, it will be null
.
Example values: "Sheet1!A1:A10" for a range or "Sheet2!A1" for a single cell.
ExternalClipboardData
Gets the external copied clipboard content.
Declaration
public string[] ExternalClipboardData { get; }
Property Value
Type | Description |
---|---|
System.String[] | An array of strings representing the content copied to the clipboard from an external source. The default value is |
Remarks
When content is copied from an external source (outside the workbook), the ExternalClipboardData
property will be updated with that content.
Otherwise, it will be null
when copying from within the workbook.
This property contains the raw text data from external sources, such as Excel, Google Sheets, or text editors, represented as an array of strings where each element represents a row of data.
This property is primarily used internally for paste operations but can be useful for implementing custom clipboard handling.
PasteRange
Gets the address of the destination cell range where the copied or cut content will be pasted.
Declaration
public string PasteRange { get; }
Property Value
Type | Description |
---|---|
System.String | A System.String specifying the target cell range for the paste action in the format "SheetName!Range". The default value is |
Remarks
This property is used to identify the destination location during clipboard operations.
The range format follows the same pattern as CopiedRange, including both the sheet name and cell references.
Example values: "Sheet1!B5:B15" for a range destination or "Sheet3!C1" for a single cell destination.