Class RadOpenFileDialogForm
Represents a dialog form that allows users to select one or more files for opening operations. This form provides a complete file browsing interface with support for multiple file selection, filtering, and various file system navigation features including network locations and custom places.
Inherited Members
Namespace: Telerik.WinControls.FileDialogs
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadOpenFileDialogForm : FileDialogFormBase, IComponentTreeHandler, ILayoutHandler, ISupportInitializeNotification, ISupportInitialize, INotifyPropertyChanged, IAnalyticsProvider, IInvokeSelectedFileSystemObjects, IMultiSelectable, IMultiFilesSelectable, IFileExtensionFilterable
Constructors
RadOpenFileDialogForm()
Initializes a new instance of the RadOpenFileDialogForm class. Sets up the form components, localizes user interface strings, and configures the explorer control for file browsing operations.
Declaration
public RadOpenFileDialogForm()
Properties
DefaultExt
Gets or sets the default file extension that will be appended to file names when no extension is specified. The extension should include the leading period (e.g., ".txt"). If set to null or empty, no default extension is applied.
Declaration
public string DefaultExt { get; set; }
Property Value
System.String
|
Implements
DereferenceLinks
Gets or sets a value indicating whether the dialog resolves shortcut links to their target files. When true, selecting a shortcut (.lnk) file returns the path to the target file. When false, selecting a shortcut returns the path to the shortcut file itself.
Declaration
public bool DereferenceLinks { get; set; }
Property Value
System.Boolean
|
ExplorerControl
Gets the ExplorerControl that provides the main file browsing interface for the dialog. This control handles file system navigation, file selection, and display of files and folders.
Declaration
public override ExplorerControl ExplorerControl { get; }
Property Value
ExplorerControl
|
Overrides
FileNames
Gets or sets a collection of full file paths for all files selected by the user. When MultiSelect is false, this collection contains at most one item. When MultiSelect is true, this collection contains all selected file paths.
Declaration
public IEnumerable<string> FileNames { get; protected set; }
Property Value
System.Collections.Generic.IEnumerable<System.String>
|
Implements
Filter
Gets or sets the file name filter string that determines which files are displayed in the dialog. The filter string contains filter pairs separated by the pipe character, where each pair consists of a description and pattern. For example: "Text files (.txt)|.txt|All files (.)|."
Declaration
public string Filter { get; set; }
Property Value
System.String
|
Implements
FilterIndex
Gets or sets the index of the currently selected filter in the file type drop-down list. The index is one-based, where 1 corresponds to the first filter in the Filter string. Setting this to 0 or an invalid index will select the first available filter.
Declaration
public int FilterIndex { get; set; }
Property Value
System.Int32
|
Implements
MultiSelect
Gets or sets a value indicating whether multiple files can be selected simultaneously in the dialog. When enabled, users can select multiple files using Ctrl+click or Shift+click, and the selected files can be accessed through FileNames.
Declaration
public bool MultiSelect { get; set; }
Property Value
System.Boolean
|
Implements
OpenFileDialogViewModel
Gets the view model that manages the data and business logic for the open file dialog. The view model provides access to the underlying data structure, state management, and operations for the dialog.
Declaration
public OpenFileDialogViewModel OpenFileDialogViewModel { get; }
Property Value
OpenFileDialogViewModel
|
ReadOnlyChecked
Gets or sets a value indicating whether the read-only checkbox in the dialog is currently checked. When checked, this typically indicates that the selected file should be opened in read-only mode. This property only has an effect when ShowReadOnly is set to true.
Declaration
public bool ReadOnlyChecked { get; set; }
Property Value
System.Boolean
|
SafeFileNames
Gets or sets a collection of file names (without path information) for all files selected by the user. This property provides only the file names and extensions, excluding the directory path. The collection corresponds to the files in FileNames but contains only the file names.
Declaration
public IEnumerable<string> SafeFileNames { get; protected set; }
Property Value
System.Collections.Generic.IEnumerable<System.String>
|
Implements
ShowReadOnly
Gets or sets a value indicating whether the dialog displays a read-only checkbox. When enabled, users can indicate their intention to open the selected file in read-only mode. The state of this checkbox can be accessed through the ReadOnlyChecked property.
Declaration
public bool ShowReadOnly { get; set; }
Property Value
System.Boolean
|
Methods
CanPressedCancelExecute()
Determines whether the cancel operation can be executed based on the current state of the dialog. This method handles special cases such as exiting edit mode for search text boxes and breadcrumb controls.
Declaration
protected override bool CanPressedCancelExecute()
Returns
System.Boolean
True if the cancel operation should proceed; otherwise, false. |
Overrides
Dispose(Boolean)
Clean up any resources being used.
Declaration
protected override void Dispose(bool disposing)
Parameters
System.Boolean
disposing
true if managed resources should be disposed; otherwise, false. |
Overrides
GetViewModel()
Creates and configures a new OpenFileDialogViewModel instance for this dialog form. This method sets up the view model with the appropriate initial directory, custom places, filtering options, and other configuration settings required for the open file dialog functionality.
Declaration
protected virtual OpenFileDialogViewModel GetViewModel()
Returns
OpenFileDialogViewModel
A configured OpenFileDialogViewModel instance ready for use with this dialog. |
InvokeSelectedFileSystemObjects()
Invokes the selected file system objects operation and attempts to execute the open command if conditions are met. This method is called when the user triggers a file selection action through various UI interactions.
Declaration
public override void InvokeSelectedFileSystemObjects()
Overrides
LocalizeStrings()
Localizes all user interface strings displayed in the dialog form using the current localization provider. This method sets the appropriate localized text for labels, buttons, and other UI elements.
Declaration
protected virtual void LocalizeStrings()
SetupDialogContent(Boolean)
Sets up the dialog content and configures UI elements based on the current view model state. This method handles the visibility of filter controls, read-only checkbox, and other dialog-specific elements.
Declaration
protected override void SetupDialogContent(bool addWatcher = true)
Parameters
System.Boolean
addWatcher
Indicates whether to add file system watchers for monitoring directory changes. |
Overrides
Explicit Interface Implementations
IMultiSelectable.SelectedFileSystemInfoWrappers
Gets the collection of selected file system information wrappers for multi-selection scenarios. This property provides access to the underlying file system objects that represent the selected items.
Declaration
ObservableCollection<FileSystemInfoWrapper> IMultiSelectable.SelectedFileSystemInfoWrappers { get; }
Returns
System.Collections.ObjectModel.ObservableCollection<FileSystemInfoWrapper>
|