Class SpreadsheetCopyPaste
Represents the class which performs all the clipboard operations such as Cut/Copy/Paste in SfSpreadsheet.
Namespace: Syncfusion.UI.Xaml.Spreadsheet
Assembly: Syncfusion.SfSpreadsheet.WPF.dll
Syntax
public class SpreadsheetCopyPaste : GridCopyPaste, IDisposable, IPasteOptionChanged
Constructors
SpreadsheetCopyPaste()
Initializes a new SpreadsheetCopyPaste.
Declaration
public SpreadsheetCopyPaste()
Properties
AllowPasteOptionPopup
Gets or sets whether the paste option popup will be shown or not after pasting.
Declaration
public bool AllowPasteOptionPopup { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True or False. |
ClipboardText
Gets or sets the copied text in clipboard when we perform paste operation.
Declaration
protected string ClipboardText { get; set; }
Property Value
Type | Description |
---|---|
System.String | Copied text. |
DefaultPasteOption
Gets or sets the default paste option.
Declaration
public PasteOptions DefaultPasteOption { get; set; }
Property Value
Type | Description |
---|---|
PasteOptions | One of the enum option in PasteOptions. |
PasteDropdownItem
Gets or sets the dropdownitem of paste operation.
Declaration
protected PasteDropDownItem PasteDropdownItem { get; set; }
Property Value
Type | Description |
---|---|
PasteDropDownItem | An instance of PasteDropDownItem. |
PasteOptionPopup
Gets or sets the paste popup.
Declaration
protected Popup PasteOptionPopup { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Controls.Primitives.Popup | An instance of System.Windows.Controls.Primitives.Popup. |
PasteRangeList
Gets or sets the ranges which are selected for pasting.
Declaration
protected GridRangeInfoList PasteRangeList { get; set; }
Property Value
Type | Description |
---|---|
GridRangeInfoList | List of ranges. |
SourceGrid
Gets or sets the copied range from grid.
Declaration
protected SpreadsheetGrid SourceGrid { get; set; }
Property Value
Type | Description |
---|---|
SpreadsheetGrid | An instance of SpreadsheetGrid. |
SourceRange
Gets or sets the selected range which is used for copy/cut operation.
Declaration
protected GridRangeInfo SourceRange { get; set; }
Property Value
Type | Description |
---|---|
GridRangeInfo | Selected range. |
SourceWorkbookRange
Gets or sets the active sheet range of workbook when we perform cut/copy operation.
Declaration
protected IRange SourceWorkbookRange { get; set; }
Property Value
Type | Description |
---|---|
IRange | Sheet range. |
TargetRange
Gets or sets the selected ranges which is used for paste operation.
Declaration
protected GridRangeInfo TargetRange { get; set; }
Property Value
Type | Description |
---|---|
GridRangeInfo | Selected range. |
TargetWorkbookRange
Gets or sets the active sheet range of workbook when we perform paste operation.
Declaration
protected IRange TargetWorkbookRange { get; set; }
Property Value
Type | Description |
---|---|
IRange | Sheet range. |
TempWorkbookRange
Gets or sets the temp sheet range of workbook when we perform paste operation.
Declaration
protected IRange TempWorkbookRange { get; set; }
Property Value
Type | Description |
---|---|
IRange | Sheet range. |
Methods
add_Copied(SpreadsheetCopiedEventHandler)
Declaration
public void add_Copied(SpreadsheetCopiedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetCopiedEventHandler | value |
add_Copying(SpreadsheetCopyingEventHandler)
Declaration
public void add_Copying(SpreadsheetCopyingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetCopyingEventHandler | value |
add_Pasted(SpreadsheetPastedEventHandler)
Declaration
public void add_Pasted(SpreadsheetPastedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetPastedEventHandler | value |
add_Pasting(SpreadsheetPastingEventHandler)
Declaration
public void add_Pasting(SpreadsheetPastingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetPastingEventHandler | value |
CanCopy()
Checks whether the selected range can be copied or not
Declaration
protected virtual bool CanCopy()
Returns
Type | Description |
---|---|
System.Boolean | True or False. |
CanCut()
Checks if the selected range can be cut or copied to the clipboard.
Declaration
protected virtual bool CanCut()
Returns
Type | Description |
---|---|
System.Boolean | True or False. |
CanPaste(GridRangeInfoList)
Checks whether the copied ranges can be pasted.
Declaration
protected virtual bool CanPaste(GridRangeInfoList mrangeList)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoList | mrangeList | Currently selected rangelist. |
Returns
Type | Description |
---|---|
System.Boolean | True or False. |
CheckMergedCells()
Determines whether the merged cells is present in the pasted region and updates the pasted range.
Declaration
protected bool CheckMergedCells()
Returns
Type | Description |
---|---|
System.Boolean | True or false. |
CheckPasswordProtected(IRange)
Returns the specified range is locked or not.
Declaration
protected bool CheckPasswordProtected(IRange range)
Parameters
Type | Name | Description |
---|---|---|
IRange | range | Selected range. |
Returns
Type | Description |
---|---|
System.Boolean | True or False. |
ClearClipboard(Boolean)
To clear the clipboard values.
Declaration
protected virtual void ClearClipboard(bool clear = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | clear | If true, clears the clipboard. |
CommitTransaction(GridRangeInfoList)
Commit transaction.
Declaration
protected void CommitTransaction(GridRangeInfoList rangeList)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoList | rangeList | List of pasted ranges |
Copy()
This function performs the copy operation in SfSpreadsheet.
Declaration
public override void Copy()
Overrides
Copy(GridRangeInfo, Boolean)
Copy the values from the given range.
Declaration
public override void Copy(GridRangeInfo range, bool needToCut)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | Currently selected range. |
System.Boolean | needToCut | Determines whether to cut/copy. |
Overrides
CopyToClipboard(GridRangeInfo)
Copies the text to the clipboard.
Declaration
protected void CopyToClipboard(GridRangeInfo copyRange)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | copyRange | Copied range. |
CopyToTargetrange(PasteOptions)
Perform the paste operation based on the option provided.
Declaration
protected void CopyToTargetrange(PasteOptions e)
Parameters
Type | Name | Description |
---|---|---|
PasteOptions | e | Selected paste option. |
CopyToTemprange(ICollection, String)
Copy the specified source range into target range.
Declaration
protected void CopyToTemprange(ICollection rangeList, string excelTargetRange)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ICollection | rangeList | Selected ranges to paste. |
System.String | excelTargetRange | Excel range to paste. |
Cut()
This function performs the cut operation in SpreadsheetGrid.
Declaration
public override void Cut()
Overrides
Dispose(Boolean)
Releases all resources used by the. SpreadsheetCopyPaste.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
GetExpandedRange(GridRangeInfoList)
Expands the Range list when it is Table, Rows, Cols to Cells.
Declaration
protected GridRangeInfoList GetExpandedRange(GridRangeInfoList rangeList)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoList | rangeList | The currently selected range. |
Returns
Type | Description |
---|---|
GridRangeInfoList | List of selected ranges. |
GetPasteDropDownItem()
To get the PasteDropDown control.
Declaration
protected virtual PasteDropDownItem GetPasteDropDownItem()
Returns
Type | Description |
---|---|
PasteDropDownItem | An instance of PasteDropDownItem. |
MoveToTargetrange(ICollection)
Move the specified source range into target range.
Declaration
protected void MoveToTargetrange(ICollection rangeList)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ICollection | rangeList | Selected ranges to paste. |
OnCopied(SpreadsheetCopiedEventArgs)
Invoked after copied the content from SfSpreadsheet.
Declaration
protected virtual void OnCopied(SpreadsheetCopiedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetCopiedEventArgs | args | A SpreadsheetCopiedEventArgs that contains the event data. |
Remarks
This method raises the Copied event.
OnCopying(SpreadsheetCopyingEventArgs)
Invoked while copying the content from SfSpreadsheet.
Declaration
protected virtual bool OnCopying(SpreadsheetCopyingEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetCopyingEventArgs | args | A SpreadsheetCopyingEventArgs that contains the event data. |
Returns
Type |
---|
System.Boolean |
Remarks
This method raises the Copying event.
OnPasted(SpreadsheetPastedEventArgs)
Invoked after pasted the content in SfSpreadsheet.
Declaration
protected virtual void OnPasted(SpreadsheetPastedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetPastedEventArgs | args | A SpreadsheetPastedEventArgs that contains the event data. |
Remarks
This method raises the Pasted event.
OnPasting(SpreadsheetPastingEventArgs)
Invoked while pasting the content in SfSpreadsheet.
Declaration
protected virtual bool OnPasting(SpreadsheetPastingEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetPastingEventArgs | args | A SpreadsheetPastingEventArgs that contains the event data. |
Returns
Type |
---|
System.Boolean |
Remarks
This method raises the Pasting event.
Paste()
This function Performs the Paste operation in SfSpreadsheet.
Declaration
public override void Paste()
Overrides
Paste(GridRangeInfoList)
To paste the values in the given range.
Declaration
public void Paste(GridRangeInfoList range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoList | range | Selected rangelist. |
Paste(GridRangeInfoList, PasteOptions)
To paste the values based on the option in the given range.
Declaration
public void Paste(GridRangeInfoList range, PasteOptions e)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfoList | range | List of selected ranges. |
PasteOptions | e | Selected Option. |
PasteFromClipboard(GridRangeInfo)
Pastes the text from clipboard.
Declaration
protected override void PasteFromClipboard(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | An instance of GridRangeInfo. |
Overrides
PasteOptionChanged(PasteOptions)
This function is invoked when the pasteoptions button is clicked.
Declaration
public void PasteOptionChanged(PasteOptions e)
Parameters
Type | Name | Description |
---|---|---|
PasteOptions | e | Option which the user selects. |
remove_Copied(SpreadsheetCopiedEventHandler)
Declaration
public void remove_Copied(SpreadsheetCopiedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetCopiedEventHandler | value |
remove_Copying(SpreadsheetCopyingEventHandler)
Declaration
public void remove_Copying(SpreadsheetCopyingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetCopyingEventHandler | value |
remove_Pasted(SpreadsheetPastedEventHandler)
Declaration
public void remove_Pasted(SpreadsheetPastedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetPastedEventHandler | value |
remove_Pasting(SpreadsheetPastingEventHandler)
Declaration
public void remove_Pasting(SpreadsheetPastingEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetPastingEventHandler | value |
UpdateMergeRange()
Update the pasted merge range.
Declaration
protected void UpdateMergeRange()
UpdateSelection(IEnumerable<GridRangeInfo>)
Updates the selection frame in SpreadsheetGrid.
Declaration
protected void UpdateSelection(IEnumerable<GridRangeInfo> mrangeList)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<GridRangeInfo> | mrangeList | List of the pasted ranges. |
UpdateTableSelectedRange()
Returns Table range selected partially or not?.
Declaration
protected bool UpdateTableSelectedRange()
Returns
Type | Description |
---|---|
System.Boolean | True or False. |
UpdateTargetRange(String)
Updates the target range.
Declaration
protected bool UpdateTargetRange(string excelTargetRange)
Parameters
Type | Name | Description |
---|---|---|
System.String | excelTargetRange | Selected excel range. |
Returns
Type |
---|
System.Boolean |
Events
Copied
Occurs after copied the content from the SfSpreadsheet.
Declaration
public event SpreadsheetCopiedEventHandler Copied
Event Type
Type |
---|
SpreadsheetCopiedEventHandler |
Copying
Occurs while copying the content from the SfSpreadsheet.
Declaration
public event SpreadsheetCopyingEventHandler Copying
Event Type
Type |
---|
SpreadsheetCopyingEventHandler |
Pasted
Occurs after the content is pasted into SfSpreadsheet.
Declaration
public event SpreadsheetPastedEventHandler Pasted
Event Type
Type |
---|
SpreadsheetPastedEventHandler |
Pasting
Occurs while pasting the content into SfSpreadsheet.
Declaration
public event SpreadsheetPastingEventHandler Pasting
Event Type
Type |
---|
SpreadsheetPastingEventHandler |