Skip to main content

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.1.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