Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

SpreadsheetClipboardOptions.PasteFormat Property

Returns or specifies the format to use when data is pasted from the clipboard onto the Spreadsheet control.

Namespace: DevExpress.XtraSpreadsheet

Assembly: DevExpress.Spreadsheet.v20.2.Core.dll

Declaration

[DefaultValue(ClipboardPasteFormat.Default)]
public ClipboardPasteFormat PasteFormat { get; set; }

Property Value

Type Default Description
ClipboardPasteFormat **Default**

An enumeration member that specifies the clipboard format.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to PasteFormat
WinForms Controls SpreadsheetControlOptions
.Clipboard .PasteFormat
Office File API DocumentOptions
.Clipboard .PasteFormat
WorkbookOptions
.Clipboard .PasteFormat

Remarks

When the PasteFormat property is set to Default, the Spreadsheet control inserts data from the clipboard in the most appropriate format. When the Spreadsheet selects the clipboard format to use, it checks each format from the ClipboardPasteFormat enumeration to determine if the clipboard contains data in this format. If a matching format is found, the Spreadsheet stops the check and uses this format to retrieve data. Below is the order in which the Spreadsheet goes through its list of supported formats:

  • ClipboardPasteFormat.Biff8
  • ClipboardPasteFormat.Biff12
  • ClipboardPasteFormat.Biff5
  • ClipboardPasteFormat.Csv
  • ClipboardPasteFormat.TabDelimited
  • ClipboardPasteFormat.DrawingObject
  • ClipboardPasteFormat.Metafile
  • ClipboardPasteFormat.Image
  • ClipboardPasteFormat.ImagesFromFiles

Use the PasteFormat property to explicitly specify the clipboard format the Spreadsheet control should use to insert data. For example, if you want to paste strings longer than 255 characters from the clipboard, set the PasteFormat property to Biff12. Otherwise, the Spreadsheet control uses the Biff8 (XLS) format to retrieve data and the inserted strings get truncated to 255 characters.

spreadsheetControl1.Options.Clipboard.PasteFormat = DevExpress.XtraSpreadsheet.ClipboardPasteFormat.Biff12;

If the Spreadsheet control cannot find data in the specified format in the clipboard, it uses the most relevant format to paste data (according to its list of supported formats).

See Also