ClassExplorerControl
Control used for the navigation part of the RadOpenFileDialog, RadSaveFileDialog and RadOpenFolderDialog
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class ExplorerControl : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl, IViewModelChangedListener, IThemeChangeListener
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlContainerControlUserControlExplorerControl
Implements:
Inherited Members
Constructors
ExplorerControl()
Initializes a new instance of the ExplorerControl class.
Declaration
public ExplorerControl()
Properties
ControlThemeClassName
Gets the theme class name used for styling the control.
Declaration
public string ControlThemeClassName { get; }
Property Value
Implements
CurrentDirectoryPath
Gets or sets the path of the current directory in this ExplorerControl instance. Setting this property navigates to the specified directory.
Declaration
public string CurrentDirectoryPath { get; set; }
Property Value
CustomPlacesPaths
Gets or sets the paths to the custom places displayed in the navigation tree view. These provide quick access to frequently used directories.
Declaration
[Browsable(false)]
public IEnumerable<string> CustomPlacesPaths { get; set; }
Property Value
IEnumerable<string>
CustomPlacesTreeNode
Gets the custom places tree node that contains shortcuts to frequently used locations.
Declaration
public RadTreeNode CustomPlacesTreeNode { get; }
Property Value
EditingOptions
Gets or sets how the files and folders in the ExplorerControl can be edited. This controls operations like renaming, creating new folders, etc. Note that shell context menu and drag and drop operations are handled separately.
Declaration
public EditingOptions EditingOptions { get; set; }
Property Value
ExpandToCurrentDirectory
Gets or sets a value indicating whether the main navigation pane automatically expands and brings into view the current directory. When true, the tree view will expand to show the current location.
Declaration
public bool ExpandToCurrentDirectory { get; set; }
Property Value
FileBrowserListView
Gets the file browser list view component that displays files and folders in the current directory.
Declaration
public FileBrowserListView FileBrowserListView { get; }
Property Value
FileBrowserListView
Filter
Gets or sets the filter string that describes the list of file extensions to filter by. This property has effect only when IsFolderBrowser is false.
FilterDescriptors
Gets the list of FileFilterDescriptor objects specified by the Filter property. This property has effect only when IsFolderBrowser is false.
Declaration
[Browsable(false)]
public IList<FileFilterDescriptor> FilterDescriptors { get; }
Property Value
IList<FileFilterDescriptor>
FilterIndex
Gets or sets the current filter index from the list of filter strings specified by the Filter property. This property has effect only when IsFolderBrowser is false.
IsDragDropEnabled
Gets or sets a value indicating whether this ExplorerControl allows drag and drop operations. When enabled, users can drag files and folders between the tree view and list view.
IsFolderBrowser
Gets or sets a value indicating whether this ExplorerControl instance is used for directory selection only or for both directories and files. When true, only directories can be selected.
LayoutType
Gets or sets the current layout type of the main file browser pane, controlling how files and folders are displayed.
MainNavigationTreeView
Gets the main navigation tree view component that displays the directory structure.
Declaration
public FileBrowserTreeView MainNavigationTreeView { get; }
Property Value
FileBrowserTreeView
MainNavigationTreeViewProportionalWidth
Gets or sets the proportional size of MainNavigationTreeView according to the total width of the ExplorerControl. This property is only considered when SizeMode is set to Proportional. The value should be between 0 and 1, with the default being 0.25.
Declaration
public float MainNavigationTreeViewProportionalWidth { get; set; }
Property Value
MinFileBrowserListViewWidth
Gets or sets the minimum width for FileBrowserListView when the ExplorerControl is resized or the separator is dragged. The value is automatically scaled for DPI.
Declaration
public int MinFileBrowserListViewWidth { get; set; }
Property Value
MinNavigationTreeViewWidth
Gets or sets the minimum width for MainNavigationTreeView when the ExplorerControl is resized or the separator is dragged. The value is automatically scaled for DPI.
Declaration
public int MinNavigationTreeViewWidth { get; set; }
Property Value
MultiSelect
Gets or sets a value indicating whether multiple selection of files or folders is allowed. When enabled, users can select multiple items using Ctrl+Click or Shift+Click.
PathNavigationBreadCrumb
Gets the breadcrumb navigation component that shows the current path.
Declaration
public FileDialogsBreadcrumb PathNavigationBreadCrumb { get; }
Property Value
FileDialogsBreadcrumb
SearchTextBox
Gets the search text box component used for file and folder searching.
Declaration
public FileDialogSearchPane SearchTextBox { get; }
Property Value
SelectedFileName
Gets the full path of the currently selected file or directory. Returns an empty string if no item is selected.
SelectedFileNames
Gets the list of full paths of the currently selected files and/or folders. In single selection mode, this list contains at most one item.
Declaration
[Browsable(false)]
public IList<string> SelectedFileNames { get; }
Property Value
IList<string>
SelectedSafeFileNames
Gets the list of names (without full path) of the currently selected files and/or folders. In single selection mode, this list contains at most one item.
Declaration
[Browsable(false)]
public IList<string> SelectedSafeFileNames { get; }
Property Value
IList<string>
ShowHiddenFiles
Gets or sets a value indicating whether hidden files and folders should be visible in the explorer. When true, files and folders with the hidden attribute will be displayed.
ShowNetworkLocations
Gets or sets a value indicating whether the dialog shows network computers in the navigation tree. When true, network locations will be accessible through the tree view.
ShowSystemCustomPlaces
Gets or sets a value indicating whether the Quick Access/Favorites items from the Windows File Explorer will be shown as child nodes in the CustomPlacesTreeNode. When enabled, system custom places like Quick Access, Desktop, Downloads, etc. will be displayed.
SizeMode
Gets or sets a value indicating how the MainNavigationTreeView width will be changed when the ExplorerControl is resized.
Declaration
public ExplorerControlSizeMode SizeMode { get; set; }
Property Value
ViewModel
This property is not relevant for this class.
Declaration
[Browsable(false)]
public DialogViewModel ViewModel { get; }
Property Value
ViewModelChangedListeners
This property is not relevant for this class.
Declaration
[Browsable(false)]
public IList<IViewModelChangedListener> ViewModelChangedListeners { get; set; }
Property Value
IList<IViewModelChangedListener>
Methods
AddCustomPlacesNode(string, Image, IList<string>)
Adds a new custom places node to the MainNavigationTreeView. This node can be used to add organized shortcuts such as Favorites, Libraries, etc.
Declaration
public CustomPlacesFileBrowserTreeNode AddCustomPlacesNode(string nodeName, Image nodeImage, IList<string> paths)
Parameters
nodeName
The display name of the custom places node.
nodeImage
The image to display for the custom places node.
paths
IList<string>
The list of directory paths that will be displayed as children of the newly created node.
Returns
CustomPlacesFileBrowserTreeNode
The created CustomPlacesFileBrowserTreeNode, or null if the parameters are invalid.
AddSystemCustomPlaces()
Adds system custom places from Windows File Explorer (Quick Access, Favorites) to the custom places node. This method uses COM interop to access Windows Shell functionality.
Declaration
protected virtual void AddSystemCustomPlaces()
CreateCustomPlacesNode()
Creates a custom places tree node with default settings.
Declaration
protected virtual CustomPlacesFileBrowserTreeNode CreateCustomPlacesNode()
Returns
CustomPlacesFileBrowserTreeNode
A new instance of CustomPlacesFileBrowserTreeNode.
CreateTreeNode(DirectoryBaseWrapper)
Creates a new tree node for the specified directory wrapper.
Declaration
public FileBrowserTreeNode CreateTreeNode(DirectoryBaseWrapper dir)
Parameters
dir
The directory wrapper to create a tree node for.
Returns
A new FileBrowserTreeNode configured for the specified directory.
Dispose(bool)
Clean up any resources being used.
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
true if managed resources should be disposed; otherwise, false.
Overrides
GetControlsHeightForCurrentTheme(string, out bool)
Gets the appropriate control height for the specified theme and determines if button fill and border should be hidden. Different themes require different control heights to maintain visual consistency.
Declaration
protected virtual int GetControlsHeightForCurrentTheme(string themeName, out bool hideButtonsFillAndBorder)
Parameters
themeName
The name of the theme to get control heights for.
hideButtonsFillAndBorder
When this method returns, contains a value indicating whether button fill and border should be hidden for the specified theme.
Returns
The control height in pixels appropriate for the specified theme.
GetDirectoryInfoWrappersFromPaths(IEnumerable<string>)
Gets a list of DirectoryInfoWrapper objects from the specified file paths.
Declaration
public List<DirectoryInfoWrapper> GetDirectoryInfoWrappersFromPaths(IEnumerable<string> paths)
Parameters
paths
IEnumerable<string>
The collection of directory paths to convert.
Returns
List<DirectoryInfoWrapper>
A list of directory info wrappers for the specified paths.
GetLayoutTypeToIconConverter()
Declaration
protected virtual LayoutTypeToIconConverter GetLayoutTypeToIconConverter()
Returns
NotifyViewModelListeners(DialogViewModel)
Notifies all registered view model listeners of a view model change.
Declaration
protected void NotifyViewModelListeners(DialogViewModel viewModel)
Parameters
viewModel
The new view model to set.
OnCurrentDirectoryPathChanged()
Called when the current directory path property changes and navigates to the new directory.
Declaration
protected virtual void OnCurrentDirectoryPathChanged()
OnFileDirectoryChanged(Action)
Handles file or directory change notifications when used in standalone mode.
Declaration
public void OnFileDirectoryChanged(Action action)
Parameters
action
The action to execute, typically on the UI thread.
OnFilterChanged()
Called when the filter property changes and processes the filtering accordingly.
Declaration
protected virtual void OnFilterChanged()
OnFilterIndexChanged()
Called when the filter index property changes and processes the filtering accordingly.
Declaration
protected virtual void OnFilterIndexChanged()
OnIsDragDropEnabledPropertyChanged()
Called when the drag and drop enabled property changes and updates the child controls accordingly.
Declaration
protected virtual void OnIsDragDropEnabledPropertyChanged()
OnLayoutChanged()
Called when the layout property changes and updates the view model accordingly.
Declaration
protected virtual void OnLayoutChanged()
OnLoad(EventArgs)
Called when the control is loaded and initializes the view model if necessary.
Declaration
protected override void OnLoad(EventArgs e)
Parameters
e
The event arguments.
Overrides
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
e
Overrides
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
e
Overrides
OnMultiSelectChanged()
Called when the multi-select property changes and updates the view model accordingly.
Declaration
protected virtual void OnMultiSelectChanged()
OnShowHiddenFilesChanged()
Called when the show hidden files property changes and updates the view model accordingly.
Declaration
protected virtual void OnShowHiddenFilesChanged()
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
e
Overrides
OnThemeChanged(ThemeChangedEventArgs)
Handles theme changes for this control and applies the new theme to the control tree. This method is called when the theme of the control or application changes.
Declaration
public void OnThemeChanged(ThemeChangedEventArgs e)
Parameters
e
The theme changed event arguments containing the new theme name.
Implements
OnViewModelChanged(DialogViewModel)
Called when the view model changes and updates all related components.
Declaration
protected virtual void OnViewModelChanged(DialogViewModel viewModel)
Parameters
viewModel
The new view model.
SetViewModel(DialogViewModel)
Sets the view model for this control and all its child components.
Declaration
public void SetViewModel(DialogViewModel viewModel)
Parameters
viewModel
The view model to set.
Implements
SetupControlsForTheme()
Sets up controls for the current application theme by determining the theme name and applying appropriate styling. This method uses the application theme name or falls back to the control's theme name.
Declaration
protected virtual void SetupControlsForTheme()
SetupControlsForTheme(string)
Sets up controls for the specified theme by configuring control heights and visual properties based on the theme requirements. Different themes may require different control dimensions and styling.
Declaration
protected virtual void SetupControlsForTheme(string themeName)
Parameters
themeName
The name of the theme to apply to the controls.
SetupViewModelListeners()
Sets up the list of view model change listeners for the control's child components.
Declaration
protected void SetupViewModelListeners()
WireEvents()
Wires up event handlers for the control's child components.
Declaration
protected virtual void WireEvents()
Events
DirectoryNavigating
Occurs when the current folder is about to change.
Declaration
public event EventHandler<DirectoryNavigatingEventArgs> DirectoryNavigating
Event Value
DirectoryRequesting
Occurs when the DirectoryInfo wrapper is about to be created.
Declaration
public event EventHandler<DirectoryRequestingEventArgs> DirectoryRequesting
Event Value
ExceptionRaised
Occurs when Exception during File (or Directory) creation / observation / modification is raised.
Declaration
public event EventHandler<FileBrowserExceptionRaisedEventArgs> ExceptionRaised
Event Value
ShellContextMenuOpening
Occurs when context menu is about to open.
Declaration
public event EventHandler<ContextMenuOpeningEventArgs> ShellContextMenuOpening
Event Value