SpreadsheetControl.DocumentSource Property
Gets or sets a document supplier for a SpreadsheetControl. This is a dependency property.
Namespace: DevExpress.Xpf.Spreadsheet
Assembly: DevExpress.Xpf.Spreadsheet.v18.2.dll
Declaration
Property Value
Type | Description |
---|---|
Object | An object specifying the document to bind to the SpreadsheetControl. |
Remarks
When the DocumentSource property is set, the SpreadsheetControl attempts to load a document specified by the property value.
The following data sources are supported:
- Stream (both seekable and non-seekable);
- String (recognized as the file path);
- Byte[] array;
- Uri;
- SpreadsheetDocumentSource instance.
The format of documents loaded from a Stream, Uri or Byte[] instance is detected automatically by the built-in IFormatDetectorService implementation.
The following formats can be detected on the fly:
- XLSX, XLSM, XLTX, XLTM (non encrypted files only);
- XLS, XLT;
- CSV, TXT (only if loaded from a FileStream instance).
If a SpreadsheetDocumentSource value is supplied, a document is loaded from the stream specified by the SpreadsheetDocumentSource.Stream property. The document format is determined by the SpreadsheetDocumentSource.Format property.
Tip
To create a new document, set the DocumentSource property to null.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the DocumentSource property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.