Back to Devexpress

DiagramControl.ShowingOpenDialog Event

windowsforms-devexpress-dot-xtradiagram-dot-diagramcontrol-a3e88c3d.md

latest4.4 KB
Original Source

DiagramControl.ShowingOpenDialog Event

Fires before showing an ‘Open File’ dialog, and allows it to be customized or replaced.

Namespace : DevExpress.XtraDiagram

Assembly : DevExpress.XtraDiagram.v25.2.dll

NuGet Package : DevExpress.Win.Diagram

Declaration

csharp
[DiagramCategory(DiagramCategory.DiagramDocument)]
public event EventHandler<DiagramShowingOpenDialogEventArgs> ShowingOpenDialog
vb
<DiagramCategory(DiagramCategory.DiagramDocument)>
Public Event ShowingOpenDialog As EventHandler(Of DiagramShowingOpenDialogEventArgs)

Event Data

The ShowingOpenDialog event's data class is DiagramShowingOpenDialogEventArgs. The following properties provide information specific to this event:

PropertyDescription
CancelGets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
DocumentSourceToOpenGets or sets the object from which to load the diagram skipping the dialog window. This object can be a full file path, Uri object, stream or array of bytes.
FilterGets or sets the string that determines the file filtering options that appear in the dialog.
InitialDirectoryGets or sets the path to the directory displayed by the dialog.
TitleGets or sets the title of the dialog.

Remarks

The Diagram Control’s Ribbon menu provides the ‘Open’ action that allows an end-user to load a diagram from an external file. The ShowingOpenDialog event fires when the ‘Open File’ dialog is about to be invoked. You can handle it to change the dialog options or prevent the dialog from being displayed. For instance, you can set the Cancel event parameter to true to suppress the default dialog and then show a custom diagram load dialog.

You can also use the following event parameters:

  • DocumentSourceToOpen - allows you to specify the object from which to automatically load the diagram. This object can be a file full path, Uri object, stream and array of bytes. If this event parameter is set, a diagram will be automatically loaded from the specified source; the default ‘Open File’ dialog will not be invoked.

  • Filter - allows you to specify a filter string that specifies the file types and descriptions to display in the ‘Open File’ dialog. This value will be used to initialize the System.Windows.Forms.FileDialog.Filter property.

  • InitialDirectory - allows you to specify the initial directory displayed by the ‘Open File’ dialog.

  • Title - allows you to specify the ‘Open File’ dialog title.

See Also

DocumentSource

CustomSaveDocument

CustomLoadDocument

ShowingSaveDialog

ShowingOpenDialog

OpenFile()

SaveFile()

SaveFileAs()

ExceptionMessage

DiagramControl Class

DiagramControl Members

DevExpress.XtraDiagram Namespace