New to Telerik UI for WinForms? Start a free 30-day trial

Wraps a Windows Forms open-file dialog and exposes its filter, selected file, and stream APIs.

Definition

Namespace:Telerik.WinControls.UI.Diagrams

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public class OpenFileDialog

Inheritance: objectOpenFileDialog

Constructors

C#
public OpenFileDialog()

Properties

Gets or sets the selected file path.

C#
public string FileName { get; set; }

Gets or sets the file-type filter displayed by the underlying dialog.

C#
public string Filter { get; set; }

Gets the selected file name without its path. Setting this property assigns the underlying dialog's FileName.

C#
public string SafeFileName { get; set; }

Methods

Opens the selected file and returns its stream.

C#
public Stream OpenFile()
Returns:

Stream

The stream opened by the underlying dialog.

Displays the dialog and reports whether the user accepted the selection.

C#
public bool ShowDialog()
Returns:

bool

true when the underlying dialog returns OK or Yes.