Edit this page

ExplorerControl

The ExplorerControl is the view that presents the UI of the dialogs. When a dialog is opened its content is shown via this control.

The ExplorerControl element can be used as a stand-alone control, thus allowing you to set is as the content of a UserControl, a Window, etc.

Defining ExplorerControl

The explorer control can be found in the Telerik.Windows.Controls.FileDialogs namespace, so in order to use it in XAML you can define the following namespace: xmlns:fileDialogs="clr-namespace:Telerik.Windows.Controls.FileDialogs;assembly=Telerik.Windows.Controls.FileDialogs".

Example 1: Define explorer control

<fileDialogs:ExplorerControl CurrentDirectoryPath="C:\Program Files"  />

Figure 1: ExplorerControl

Common Features

The ExplorerControl supports most of the features described in the Features section of the documentation.

Browser Mode

The control can work in two modes - the first one allows you to select folders and files. The second one allows you to select only folders. You can control this via the IsFolderBrowser property. If you set the property to True you will be able to see and select only folders.

Example 2: Allow selecting folders only

<fileDialogs:ExplorerControl IsFolderBrowser="True" />

To navigate the explorer to a specific directory you can set its CurrentDirectoryPath property as shown in Example 1.

Selection

To get the selected files or folders you can use the SelectedFileName, SelectedFileNames and SelectedSafeFileNames properties of the control.

The difference between SelectedFileNames and SelectedSafeFileNames is that the first collection contains the full paths of the files/folders. And the second collection contains only the names (safe names) of the files/folders.

Example 3: Getting the first item from the selected files/folders

string selectedFile = this.explorerControl.SelectedFileNames[0];

By default the selection mode is single which allows you to select a single file or folder. To change this you can set the Multiselect property to True.

Example 4: Enable multi selection

<fileDialogs:ExplorerControl Multiselect="True" />

Filtering

The ExplorerControl can be filtered using its Filter and FilterIndex properties. Read more about them in the Filtering article.

Filtering is available only if the IsFolderBrowser property is set to False.

Events

The control exposes the following events - DirectoryRequesting and ExceptionRaised. Read more about the events and their arguments in the Events article.

See Also

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy