Back to Devexpress

DiagramControl.LoadDocument(Stream) Method

windowsforms-devexpress-dot-xtradiagram-dot-diagramcontrol-dot-loaddocument-x28-system-dot-io-dot-stream-x29.md

latest2.9 KB
Original Source

DiagramControl.LoadDocument(Stream) Method

Loads a diagram stored in the specified stream.

Namespace : DevExpress.XtraDiagram

Assembly : DevExpress.XtraDiagram.v25.2.dll

NuGet Package : DevExpress.Win.Diagram

Declaration

csharp
public void LoadDocument(
    Stream stream
)
vb
Public Sub LoadDocument(
    stream As Stream
)

Parameters

NameTypeDescription
streamStream

A stream that stores the diagram to be loaded.

|

Remarks

A diagram can be saved to a file or stream with the DiagramControl.SaveDocument method.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the LoadDocument(Stream) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

how-to-handle-diagramcontrol-events-to-save-diagrams-to-a-database-instead-of-a-file-system-t360920/CS/XtraDiagram.CustomDiagramStorage/Form1.cs#L41

csharp
if (diagramData != null)
    diagramControl1.LoadDocument(new MemoryStream(diagramData));
e.Handled = true;

how-to-handle-diagramcontrol-events-to-save-diagrams-to-a-database-instead-of-a-file-system-t360920/VB/XtraDiagram.CustomDiagramStorage/Form1.vb#L41

vb
Dim diagramData = DiagramRepository.GetDiagramData(diagramName)
If diagramData IsNot Nothing Then diagramControl1.LoadDocument(New MemoryStream(diagramData))
e.Handled = True

See Also

DiagramControl Class

DiagramControl Members

DevExpress.XtraDiagram Namespace