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

Prompts the user to open a file.

Definition

Namespace:Telerik.WinControls.Spreadsheet.UI

Assembly:Telerik.WinControls.RadSpreadsheet.dll

Syntax:

C#
public class OpenFileDialog

Inheritance: objectOpenFileDialog

Constructors

Initializes an instance of the Telerik.WinControls.Spreadsheet.UI.OpenFileDialog class.

C#
public OpenFileDialog()

Initializes an instance of the Telerik.WinControls.Spreadsheet.UI.OpenFileDialog class by given parameter of type System.Windows.Forms.OpenFileDialog.

C#
public OpenFileDialog(OpenFileDialog dialog)
Parameters:dialogOpenFileDialog

The open file dialog.

Properties

Gets or sets a string containing the file name selected in the file dialog box.

C#
public string FileName { get; set; }

Gets or sets the current file name filter string, which determines the choices that appear in the "Save as file type" or "Files of type" box in the dialog box.

C#
public string Filter { get; set; }

Gets the file name and extension for the file selected in the dialog box. The file name does not include the path.

C#
public string SafeFileName { get; set; }
Property Value:

The file name and extension for the file selected in the dialog box. The file name does not include the path. The default value is an empty string.

Methods

Opens the file selected by the user, with read-only permission. The file is specified by the System.Windows.Forms.FileDialog.FileName property.

C#
public Stream OpenFile()
Returns:

Stream

A System.IO.Stream that specifies the read-only file selected by the user.

Runs a common dialog box with a default owner.

C#
public bool ShowDialog()
Returns:

bool

true if the DialogResult is OK or Yes; otherwise false