aspnet-devexpress-dot-web-dot-aspxspreadsheet-dot-aspxspreadsheet-917c004e.md
Creates a document in the ASPxSpreadsheet.
Namespace : DevExpress.Web.ASPxSpreadsheet
Assembly : DevExpress.Web.ASPxSpreadsheet.v25.2.dll
NuGet Package : DevExpress.Web.Office
public void New()
Public Sub New
Call the New method to create a document.
A new document has an empty DocumentID value, thus the document is not accessible from the DocumentManager API. The ASPxSpreadsheet retains such a document until the control switches to another document.
The ASPxSpreadsheet generates a DocumentID value for the document when a user saves it to a file system. Alternatively, you can assign a GUID to the DocumentId property explicitly:
ASPxSpreadsheet1.New();
ASPxSpreadsheet1.DocumentId = Guid.NewGuid().ToString();
ASPxSpreadsheet1.New()
ASPxSpreadsheet1.DocumentId = Guid.NewGuid.ToString()
If the specified DocumentID value is not unique within all open documents, the ASPxSpreadsheet throws an exception. Call the GetAllDocuments() method to get identifiers of all open documents.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the New() method.
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.
var spreadsheet = SpreadsheetRequestProcessor.GetSpreadsheetFromState(spreadsheetState);
spreadsheet.New();
FillInDocument(spreadsheet.Document.Worksheets[0]);
See Also