Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SpreadsheetControl.CreateNewDocument() Method

Creates and loads a new empty workbook.

Namespace: DevExpress.Xpf.Spreadsheet

Assembly: DevExpress.Xpf.Spreadsheet.v24.2.dll

NuGet Package: DevExpress.Wpf.Spreadsheet

#Declaration

public bool CreateNewDocument()

#Returns

Type Description
Boolean

true, if the document is created successfully; otherwise, false.

#Remarks

If the WorkbookEventOptions.RaiseOnModificationsViaAPI property is set to true and the SpreadsheetControl’s document has unsaved changes (the SpreadsheetControl.Modified property is true), using the CreateNewDocument method will raise the SpreadsheetControl.DocumentClosing event.

By handling the SpreadsheetControl.DocumentClosing event, you can set e.Cancel to true to prevent a document from closing. In this case, the CreateNewDocument method will return false.

If the new document was created and successfully loaded, the CreateNewDocument method returns true.

See Also