Back to Devexpress

Paste Special Dialog

wpf-118677-controls-and-libraries-spreadsheet-visual-elements-dialogs-paste-special-dialog.md

latest2.5 KB
Original Source

Paste Special Dialog

  • May 14, 2021
  • 2 minutes to read

The Paste Special dialog allows end-users to specify additional paste options after cutting or copying data to the Clipboard.

An end-user can specify the format of the pasted data using one of the following options available in the Paste Special dialog:

OptionDescription
AllPastes all cell content and formatting.
FormulasPastes formulas as entered in the Formula Bar. Note that the relative cell references within the formula will be adjusted automatically to reflect the new location.
ValuesPastes cell values only (including the formula results, but not the formulas themselves).
FormatsPastes cell formatting only.
CommentsPastes only the comments added to cells.
All except bordersPastes cell content and formatting without cell borders.
Column widthsApplies the column widths of the copied cells to another range of columns.
Formulas and number formatsPastes only the formulas and number formatting options from the copied cells.
Values and number formatsPastes only the values and number formatting options from the copied cells.
Skip blanksPastes the values of all cells except for empty cells.

To provide end-users with the capability to invoke the Paste Special dialog, add the Clipboard ribbon group to the SpreadsheetControl. For an example on how to create a spreadsheet application with the ribbon UI, refer to the Create a Simple Spreadsheet Application tutorial.

To programmatically specify the part of the data to be pasted in the target cells, use the CellRange.CopyFrom method, which accepts a value of the PasteSpecial enumeration as a parameter. For details, refer to the How to: Copy Cell Data Only, Cell Style Only, or Cell Data with Style and How to: Copy a Row or Column examples.