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

Saving and Loading Diagrams

A diagram can be saved to an XML file and then loaded from this file at design time and runtime.

At design time, use the dedicated Save, Save As and Open menu buttons provided by the Diagram Designer.

diagram saving

In code, a diagram can be saved/loaded to/from a file or stream with the DiagramControl.SaveDocument and DiagramControl.LoadDocument methods.

You can implement custom logic for loading and saving diagrams by handling the DiagramControl.CustomSaveDocument and DiagramControl.CustomLoadDocument events.

To enable serialization for custom item types, use the DiagramItemTypeRegistrator.Register method. To modify the list of serialized properties, use the DiagramControl.CustomGetSerializableItemProperties event. Alternatively, mark the additional properties of a custom item type with the DevExpress.Utils.Serializing.XtraSerializableProperty attribute.