New to Telerik UI for WinFormsStart a free 30-day trial

Represents a save file dialog component that allows users to select a location and filename for saving files. This dialog provides advanced file browsing capabilities with file extension filtering, overwrite prompts, and configurable editing options for file operations.

Definition

Constructors

Initializes a new instance of the RadSaveFileDialog class with default settings and creates the underlying save file dialog form for user interaction.

C#
public RadSaveFileDialog()

Properties

Gets or sets a value indicating whether the dialog box prompts the user for permission to create a file if the user specifies a file that does not exist, providing control over file creation behavior in the save dialog.

C#
public bool CreatePrompt { get; set; }
Property Value:

true if the dialog box prompts the user before creating a file if the user specifies a file name that does not exist; false if the dialog box automatically creates the new file without prompting the user for permission. The default value is false.

Gets or sets the default file name extension that will be automatically appended to file names when no extension is specified by the user, ensuring proper file type identification and system compatibility.

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

A string representing the default file extension without the leading dot (e.g., "txt", "doc", "pdf").

Implements: IFileExtensionFilterable.DefaultExt

Gets or sets the editing options that determine how files and folders in the ExplorerControl can be modified, providing fine-grained control over user interaction capabilities within the dialog's file system view.

C#
public EditingOptions EditingOptions { get; set; }
Property Value:

An EditingOptions enumeration value that specifies which file and folder operations are permitted.

Remarks:

Note that shell context menu and drag and drop operations are handled separately from these editing options.

Gets or sets the current file name filter string that determines which types of files are displayed in the dialog, allowing users to view only specific file formats and providing a convenient way to narrow file selection choices.

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

A string containing one or more file filter patterns separated by the vertical bar character (|), where each filter consists of a description followed by the pattern (e.g., "Text files (.txt)|.txt|All files (.)|.").

Implements: IFileExtensionFilterable.Filter

Gets or sets the index of the currently selected filter in the file type filter dropdown, allowing programmatic control over which file filter is active when the dialog is displayed to the user.

C#
public int FilterIndex { get; set; }
Property Value:

A one-based integer representing the index of the selected filter, where 1 corresponds to the first filter in the Filter string.

Implements: IFileExtensionFilterable.FilterIndex

Gets or sets a value indicating whether the Save As dialog box displays a warning if the user specifies a file name that already exists, providing safety against accidental file overwrites.

C#
public bool OverwritePrompt { get; set; }
Property Value:

true if the dialog box prompts the user before overwriting an existing file if the user specifies a file name that already exists; false if the dialog box automatically overwrites the existing file without prompting the user for permission. The default value is true.

Gets the underlying RadSaveFileDialogForm that provides the visual interface and functionality for the file save dialog.

C#
public RadSaveFileDialogForm SaveFileDialogForm { get; }

Gets the view model that manages the data and business logic for the save file dialog, providing access to the underlying file selection and navigation functionality.

C#
public SaveFileDialogViewModel SaveFileDialogViewModel { get; }

Methods

Creates and returns a new instance of the specialized save file dialog form that provides the user interface for file selection and saving operations.

C#
protected override FileDialogFormBase CreateFileDialogForm()
Returns:

FileDialogFormBase

A new RadSaveFileDialogForm instance configured for save file dialog operations.

Overrides: FileDialogComponentBase.CreateFileDialogForm()

Creates a read-write file stream for the filename selected by the user using the save file dialog, providing direct access to the selected file for writing operations.

C#
[SecurityCritical]
public Stream OpenFile()
Returns:

Stream

A new Stream that contains the selected file opened for both reading and writing with Create mode.

Exceptions:

ArgumentNullException

Selected file is null.

ArgumentException

Selected file is empty string, contains only white space, contains one or more invalid characters, or refers to a non-file device.

NotSupportedException

Selected file refers to a non-file device.

FileNotFoundException

Selected file cannot be found, such as when mode is FileMode.Truncate or FileMode.Open, and the file specified by path does not exist. The file must already exist in these modes.

IOException

An I/O error occurred or the stream has been closed.

SecurityException

The caller does not have the required permission.

DirectoryNotFoundException

Selected file is invalid, such as being on an unmapped drive.

UnauthorizedAccessException

The access requested is not permitted by the operating system for the specified path, such as when access is Write or ReadWrite and the file or directory is set for read-only access.

PathTooLongException

The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.

ArgumentOutOfRangeException

The specified mode contains an invalid value.