Gets or sets a document supplier for a SpreadsheetControl. This is a dependency property.
An object specifying the document to bind to the SpreadsheetControl.
When the DocumentSource property is set, the SpreadsheetControl attempts to load a document specified by the property value.
You can use the following data sources:
- Stream (both seekable and non-seekable);
- String (recognized as the file path);
- Byte array;
- SpreadsheetDocumentSource instance.
The following formats can be detected on the fly:
- XLSX, XLSB, XLSM, XLTX, XLTM (non encrypted files only);
- XLS, XLT;
- XML Spreadsheet 2003;
- 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.
Set the DocumentSource property to null to create a new document.
The code sample below binds an XLSX file as the document source:
<Grid> <dxsps:SpreadsheetControl CommandBarStyle="Ribbon" ShowFormulaBar="True" DocumentSource="pack://application:,,,/WpfSpreadsheet;component/Document.xlsx"/> </Grid>