ExplorerControl
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
Initializes a new instance of the ExplorerControl class.
public ExplorerControl()
Properties
Gets the theme class name used for styling the control.
public string ControlThemeClassName { get; }
Implements:
Gets or sets the path of the current directory in this ExplorerControl instance. Setting this property navigates to the specified directory.
public string CurrentDirectoryPath { get; set; }
CustomPlacesPaths
IEnumerable<string>
Gets or sets the paths to the custom places displayed in the navigation tree view. These provide quick access to frequently used directories.
[Browsable(false)]
public IEnumerable<string> CustomPlacesPaths { get; set; }
Gets the custom places tree node that contains shortcuts to frequently used locations.
public RadTreeNode CustomPlacesTreeNode { get; }
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.
public EditingOptions EditingOptions { get; set; }
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.
public bool ExpandToCurrentDirectory { get; set; }
FileBrowserListView
FileBrowserListView
Gets the file browser list view component that displays files and folders in the current directory.
public FileBrowserListView FileBrowserListView { get; }
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.
public string Filter { get; set; }
Gets the list of FileFilterDescriptor objects specified by the Filter property. This property has effect only when IsFolderBrowser is false.
[Browsable(false)]
public IList<FileFilterDescriptor> FilterDescriptors { get; }
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.
public int FilterIndex { get; set; }
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.
public bool IsDragDropEnabled { get; set; }
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.
public bool IsFolderBrowser { get; set; }
Gets or sets the current layout type of the main file browser pane, controlling how files and folders are displayed.
public LayoutType LayoutType { get; set; }
MainNavigationTreeView
FileBrowserTreeView
Gets the main navigation tree view component that displays the directory structure.
public FileBrowserTreeView MainNavigationTreeView { get; }
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.
public float MainNavigationTreeViewProportionalWidth { get; set; }
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.
public int MinFileBrowserListViewWidth { get; set; }
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.
public int MinNavigationTreeViewWidth { get; set; }
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.
public bool MultiSelect { get; set; }
PathNavigationBreadCrumb
FileDialogsBreadcrumb
Gets the breadcrumb navigation component that shows the current path.
public FileDialogsBreadcrumb PathNavigationBreadCrumb { get; }
Gets the search text box component used for file and folder searching.
public FileDialogSearchPane SearchTextBox { get; }
Gets the full path of the currently selected file or directory. Returns an empty string if no item is selected.
public string SelectedFileName { get; }
SelectedFileNames
IList<string>
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.
[Browsable(false)]
public IList<string> SelectedFileNames { get; }
SelectedSafeFileNames
IList<string>
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.
[Browsable(false)]
public IList<string> SelectedSafeFileNames { get; }
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.
public bool ShowHiddenFiles { get; set; }
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.
public bool ShowNetworkLocations { get; set; }
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.
public bool ShowSystemCustomPlaces { get; set; }
Gets or sets a value indicating how the MainNavigationTreeView width will be changed when the ExplorerControl is resized.
public ExplorerControlSizeMode SizeMode { get; set; }
This property is not relevant for this class.
[Browsable(false)]
public DialogViewModel ViewModel { get; }
This property is not relevant for this class.
[Browsable(false)]
public IList<IViewModelChangedListener> ViewModelChangedListeners { get; set; }
Methods
Adds a new custom places node to the MainNavigationTreeView. This node can be used to add organized shortcuts such as Favorites, Libraries, etc.
public CustomPlacesFileBrowserTreeNode AddCustomPlacesNode(string nodeName, Image nodeImage, IList<string> paths)
The display name of the custom places node.
nodeImageImageThe image to display for the custom places node.
pathsIList<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.
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.
protected virtual void AddSystemCustomPlaces()
Creates a custom places tree node with default settings.
protected virtual CustomPlacesFileBrowserTreeNode CreateCustomPlacesNode()
CustomPlacesFileBrowserTreeNode
A new instance of CustomPlacesFileBrowserTreeNode.
Creates a new tree node for the specified directory wrapper.
public FileBrowserTreeNode CreateTreeNode(DirectoryBaseWrapper dir)
The directory wrapper to create a tree node for.
Returns:A new FileBrowserTreeNode configured for the specified directory.
Clean up any resources being used.
protected override void Dispose(bool disposing)
true if managed resources should be disposed; otherwise, false.
Overrides:
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.
protected virtual int GetControlsHeightForCurrentTheme(string themeName, out bool hideButtonsFillAndBorder)
The name of the theme to get control heights for.
hideButtonsFillAndBorderboolWhen 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.
Gets a list of DirectoryInfoWrapper objects from the specified file paths.
public List<DirectoryInfoWrapper> GetDirectoryInfoWrappersFromPaths(IEnumerable<string> paths)
The collection of directory paths to convert.
Returns:List<DirectoryInfoWrapper>
A list of directory info wrappers for the specified paths.
protected virtual LayoutTypeToIconConverter GetLayoutTypeToIconConverter()
Notifies all registered view model listeners of a view model change.
protected void NotifyViewModelListeners(DialogViewModel viewModel)
The new view model to set.
Called when the current directory path property changes and navigates to the new directory.
protected virtual void OnCurrentDirectoryPathChanged()
Handles file or directory change notifications when used in standalone mode.
public void OnFileDirectoryChanged(Action action)
The action to execute, typically on the UI thread.
Called when the filter property changes and processes the filtering accordingly.
protected virtual void OnFilterChanged()
Called when the filter index property changes and processes the filtering accordingly.
protected virtual void OnFilterIndexChanged()
Called when the drag and drop enabled property changes and updates the child controls accordingly.
protected virtual void OnIsDragDropEnabledPropertyChanged()
Called when the layout property changes and updates the view model accordingly.
protected virtual void OnLayoutChanged()
Called when the control is loaded and initializes the view model if necessary.
Called when the multi-select property changes and updates the view model accordingly.
protected virtual void OnMultiSelectChanged()
Called when the show hidden files property changes and updates the view model accordingly.
protected virtual void OnShowHiddenFilesChanged()
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.
public void OnThemeChanged(ThemeChangedEventArgs e)
The theme changed event arguments containing the new theme name.
Implements:
Called when the view model changes and updates all related components.
protected virtual void OnViewModelChanged(DialogViewModel viewModel)
The new view model.
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.
protected virtual void SetupControlsForTheme()
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.
protected virtual void SetupControlsForTheme(string themeName)
The name of the theme to apply to the controls.
Sets up the list of view model change listeners for the control's child components.
protected void SetupViewModelListeners()
Sets the view model for this control and all its child components.
public void SetViewModel(DialogViewModel viewModel)
The view model to set.
Implements:
Wires up event handlers for the control's child components.
protected virtual void WireEvents()
Events
Occurs when the current folder is about to change.
public event EventHandler<DirectoryNavigatingEventArgs> DirectoryNavigating
Occurs when the DirectoryInfo wrapper is about to be created.
public event EventHandler<DirectoryRequestingEventArgs> DirectoryRequesting
Occurs when Exception during File (or Directory) creation / observation / modification is raised.
public event EventHandler<FileBrowserExceptionRaisedEventArgs> ExceptionRaised
Occurs when context menu is about to open.
public event EventHandler<ContextMenuOpeningEventArgs> ShellContextMenuOpening