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.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadSaveFileDialog : FileDialogComponentBase, IFileExtensionFilterable
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
System.Boolean
|
See Also
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
System.String
A string representing the default file extension without the leading dot (e.g., "txt", "doc", "pdf"). |
Implements
See Also
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
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.
See Also
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
System.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
See Also
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
public int FilterIndex { get; set; }
Property Value
System.Int32
A one-based integer representing the index of the selected filter, where 1 corresponds to the first filter in the Filter string. |
Implements
See Also
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
System.Boolean
|
See Also
SaveFileDialogForm
Gets the underlying RadSaveFileDialogForm that provides the visual interface and functionality for the file save dialog.
Declaration
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
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
protected override FileDialogFormBase CreateFileDialogForm()
Returns
FileDialogFormBase
A new RadSaveFileDialogForm instance configured for save file dialog operations. |
Overrides
See Also
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
System.IO.Stream
A new System.IO.Stream that contains the selected file opened for both reading and writing with Create mode. |
Exceptions
System.ArgumentNullException
Selected file is null. |
System.ArgumentException
Selected file is empty string, contains only white space, contains one or more invalid characters, or refers to a non-file device. |
System.NotSupportedException
Selected file refers to a non-file device. |
System.IO.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. |
System.IO.IOException
An I/O error occurred or the stream has been closed. |
System.Security.SecurityException
The caller does not have the required permission. |
System.IO.DirectoryNotFoundException
Selected file is invalid, such as being on an unmapped drive. |
System.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. |
System.IO.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. |
System.ArgumentOutOfRangeException
The specified mode contains an invalid value. |