ClassRadSaveFileDialog
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:
public class RadSaveFileDialog : FileDialogComponentBase, IComponent, IDisposable, IFileExtensionFilterable
Inheritance: objectMarshalByRefObjectComponentFileDialogComponentBaseRadSaveFileDialog
Implements:
Inherited Members
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
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
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.
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
public string DefaultExt { get; set; }
Property Value
A string representing the default file extension without the leading dot (e.g., "txt", "doc", "pdf").
Implements
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
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.
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
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
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.
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
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.
SaveFileDialogForm
Gets the underlying RadSaveFileDialogForm that provides the visual interface and functionality for the file save dialog.
Declaration
public RadSaveFileDialogForm SaveFileDialogForm { get; }
Property Value
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
public SaveFileDialogViewModel SaveFileDialogViewModel { get; }
Property Value
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
protected override FileDialogFormBase CreateFileDialogForm()
Returns
A new RadSaveFileDialogForm instance configured for save file dialog operations.
Overrides
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
[SecurityCritical]
public Stream OpenFile()
Returns
A new Stream that contains the selected file opened for both reading and writing with Create mode.
Exceptions
Selected file is null.
Selected file is empty string, contains only white space, contains one or more invalid characters, or refers to a non-file device.
Selected file refers to a non-file device.
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.
An I/O error occurred or the stream has been closed.
The caller does not have the required permission.
Selected file is invalid, such as being on an unmapped drive.
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.
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.
The specified mode contains an invalid value.