Class
RadSaveFileDialog

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

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

cs-api-definition
public class RadSaveFileDialog : FileDialogComponentBase, IComponent, IDisposable, IFileExtensionFilterable

Inheritance: objectMarshalByRefObjectComponentFileDialogComponentBaseRadSaveFileDialog

Implements: IComponentIDisposableIFileExtensionFilterable

Inherited Members FileDialogComponentBase.ShowDialog()FileDialogComponentBase.ShowDialog(IWin32Window)FileDialogComponentBase.OpenFileInternal(FileMode, FileAccess)FileDialogComponentBase.DialogFormFileDialogComponentBase.FileNameFileDialogComponentBase.ShowNetworkLocationsFileDialogComponentBase.InitialDirectoryFileDialogComponentBase.RestoreDirectoryFileDialogComponentBase.CustomPlacesFileDialogComponentBase.ExpandToCurrentDirectoryFileDialogComponentBase.ShowHiddenFilesFileDialogComponentBase.InitialSelectedLayoutFileDialogComponentBase.DirectoryRequestingFileDialogComponentBase.DirectoryNavigatingFileDialogComponentBase.ShellContextMenuOpeningFileDialogComponentBase.ExceptionRaisedComponent.Dispose()Component.Dispose(bool)Component.GetService(Type)Component.ToString()Component.CanRaiseEventsComponent.EventsComponent.SiteComponent.ContainerComponent.DesignModeComponent.DisposedMarshalByRefObject.MemberwiseClone(bool)MarshalByRefObject.GetLifetimeService()MarshalByRefObject.InitializeLifetimeService()MarshalByRefObject.CreateObjRef(Type)

Constructors

RadSaveFileDialog()

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

Declaration

cs-api-definition
public RadSaveFileDialog()

Properties

CreatePrompt

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.

Declaration

cs-api-definition
public bool CreatePrompt { get; set; }

Property Value

bool

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.

DefaultExt

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.

Declaration

cs-api-definition
public string DefaultExt { get; set; }

Property Value

string

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

Implements IFileExtensionFilterable.DefaultExt

EditingOptions

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.

Declaration

cs-api-definition
public EditingOptions EditingOptions { get; set; }

Property Value

EditingOptions

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.

Filter

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.

Declaration

cs-api-definition
public string Filter { get; set; }

Property Value

string

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

FilterIndex

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.

Declaration

cs-api-definition
public int FilterIndex { get; set; }

Property Value

int

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

OverwritePrompt

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.

Declaration

cs-api-definition
public bool OverwritePrompt { get; set; }

Property Value

bool

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.

SaveFileDialogForm

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

Declaration

cs-api-definition
public RadSaveFileDialogForm SaveFileDialogForm { get; }

Property Value

RadSaveFileDialogForm

SaveFileDialogViewModel

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.

Declaration

cs-api-definition
public SaveFileDialogViewModel SaveFileDialogViewModel { get; }

Property Value

SaveFileDialogViewModel

Methods

CreateFileDialogForm()

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

Declaration

cs-api-definition
protected override FileDialogFormBase CreateFileDialogForm()

Returns

FileDialogFormBase

A new RadSaveFileDialogForm instance configured for save file dialog operations.

Overrides FileDialogComponentBase.CreateFileDialogForm()

OpenFile()

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.

Declaration

cs-api-definition
[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.