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

DiagramControl.SaveFileAs() Method

In This Article

Displays the “Save File As” dialog that allows an end-user to save the current diagram to an XML file.

Namespace: DevExpress.XtraDiagram

Assembly: DevExpress.XtraDiagram.v24.2.dll

NuGet Package: DevExpress.Win.Diagram

#Declaration

public void SaveFileAs()

#Remarks

The Diagram Control’s Ribbon menu contains the “Save As” button that redirects the save action to the SaveFileAs method. The SaveFileAs method invokes the “Save File As” dialog that allows an end-user to save the current diagram to an XML file.

The full name of the file to which the diagram is saved is automatically assigned to the DiagramControl.DocumentSource property. The DiagramControl.SaveFile method saves the diagram to storage silently if the DiagramControl.DocumentSource property is set. Otherwise, the DiagramControl.SaveFile method delegates the saving action to the SaveFileAs method.

The DiagramControl.ShowingSaveDialog event allows you to replace the standard “Save File As” dialog with a custom one or perform your own actions when this dialog is about to be shown.

To implement diagram custom saving logic, handle the DiagramControl.CustomSaveDocument event.

To save the diagram without invoking any dialogs in code, use the DiagramControl.SaveDocument method.

You may encounter exceptions when loading/saving a diagram (e.g., when trying to load a diagram from a file that does not exist, or saving to a read-only file). To handle or suppress these exceptions, use the DiagramControl.ExceptionMessage event.

See Also