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.SaveDocument(IWin32Window) Method

Saves a document to the original file location. For a new document, the method invokes the Save As modal dialog box with the specified owner.

Namespace: DevExpress.Xpf.Spreadsheet

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

NuGet Package: DevExpress.Wpf.Spreadsheet

#Declaration

public virtual bool SaveDocument(
    IWin32Window parent
)

#Parameters

Name Type Description
parent IWin32Window

An object that implements the IWin32Window interface. The object is the top-level window that will own the modal dialog box.

#Returns

Type Description
Boolean

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

#Remarks

If the document is loaded from a file, the WorkbookSaveOptions.CurrentFileName and WorkbookSaveOptions.CurrentFormat properties are set to the file name and format of the original document. The SaveDocument method saves a document as a file with the name taken from the CurrentFileName property in the format specified by the CurrentFormat property.

If the CurrentFileName property is empty or the CurrentFormat property equals the DocumentFormat.Undefined value, the SaveDocument method displays the Save As dialog box. This allows users to browse folders and specify a filename and format to which to save the document.

See Also