# Common

This articles shows the features shared between all file dialogs controls - **RadOpenFileDialog, RadSaveFileDialog, RadOpenFolderDialog** and **ExplorerControl** .

## Setting Initial Directory

All the dialog controls expose a **InitialDirectory** property that determines the directory that will be opened when the dialog shows.

**Setting initial directory**

```C#
RadSaveFileDialog saveFileDialog = new RadSaveFileDialog();
saveFileDialog.Owner = this;

saveFileDialog.InitialDirectory = @"C:\Temp\";

saveFileDialog.ShowDialog();
```

## Setting the Initial Layout of the Tiles

All the dialog controls expose a **InitialSelectedLayout** property that determines the initial layout of the list with the files

**Setting initial layout**

```C#
RadSaveFileDialog saveFileDialog = new RadSaveFileDialog();
saveFileDialog.Owner = this;

saveFileDialog.InitialSelectedLayout = Telerik.Windows.Controls.FileDialogs.LayoutType.Tiles;

saveFileDialog.ShowDialog();
```

> caption RadOpenFileDialog in tile view mode in the Office2016 theme

![RadOpenFileDialog in Tile view mode](https://www.telerik.com/products/wpf/documentation/assets/055b68a5bf9fc26b41d8c2ddb0f1afa6/filedialogs_tileviewmode.png)

The layout is determined by the LayoutType enum that provides the following modes:

* **SmallIcons**

* **MediumIcons**

* **LargeIcons**

* **ExtraLargeIcons**

* **List**

* **Tiles**

* **Details**

## New Folder Button

Since **R1 2018**, you can add a new folder in all the dialog controls with the **New Folder** button. The created folder enters edit mode in all [Layout View Modes](https://www.telerik.com/products/wpf/documentation/controls/radfiledialogs/features/common#setting-the-initial-layout-of-the-tiles).

> caption New folder button and new folder in edit mode in the Office2016 theme

![New Folder button](https://www.telerik.com/products/wpf/documentation/assets/502c4d76746377b5b8e3baff58937682/filedialogs_newfolder.png)

## Edit Mode

In order to edit the selected file/folder, you can press the **F2** key. Alternatively, you can click on the TextBlock which holds the file/folder name in all layouts except the **Details** layout where you can click on the cell holding the file/folder name. If you try to add a reserved character in a file/folder name, you will receive the warning illustrated below.

> caption Reserved character warning in the Office2016 theme

![Reserved character warning](https://www.telerik.com/products/wpf/documentation/assets/2afccfc99776441812f13d87eedec813/filedialogs_editmode.png)

Trying to change the file extension prompts the message box shown below.

> caption Changing file extension message box in the Office2016 theme

![Changing file extension message box](https://www.telerik.com/products/wpf/documentation/assets/7b369ea43e5a721405d48ac00dcc2b47/filedialogs_changefileextensionmessagebox.png)

## Using the ContextMenu

As of **R1 2018 RadFileDialogs** has a ContextMenu. The well-known ContextMenu used in Windows is used for this purpose. It is available for the **RadListBox, RadTreeView and RadGridView** components used in the Main Pane.

> caption Showing the ContextMenu

![Showing the ContextMenu](https://www.telerik.com/products/wpf/documentation/assets/3fe68ec5d6e86b0cfed3ab6498c6f0f9/filedialogs_contextmenu.png)

## Disable the Automatic Expanding to Current Directory

By default the main pane with the files/folders and the navigation tree are synced and when you navigate through the folders the selection in the tree navigation pane will also be updated. To disable this you can set the **ExpandToCurrentDirectory** property of the dialog to False.

**Disabling the automatic expanding to current directory**

```C#
RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
openFileDialog.Owner = theOwnerWindow;
openFileDialog.ExpandToCurrentDirectory = false;
openFileDialog.ShowDialog();
```

> tip When enabled the automatic expanding always synchronizes the files/folders list with the navigation tree. If you want to sync them only on load of the control, you can skip setting the property initially and then subscribe to the Loaded event of the dialog. In the event handler you can set the ExpandToCurrentDirectory property to False.

## Show Hidden Files

By default the file dialogs don't show hidden files and folders. To show them you can set the **ShowHiddenFiles** property of the corresponding file dialog control to True.

**Enable showing hidden files and folders**

```C#
RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
openFileDialog.Owner = this;
openFileDialog.ShowHiddenFiles = true;
openFileDialog.ShowDialog();
```

> caption Showing hidden files

![Showing hidden files](https://www.telerik.com/products/wpf/documentation/assets/398c08b01cc8c125f6575a0770a72e5c/radfiledialogs-features-common-0.png)

## Load Drives in Background

By default, when the file dialogs are shown, they will load all shared drives under the "This PC" node. There are scenarios when some drives are expected to load slower than normal. This could cause a delay in loading the file dialogs. In such scenarios, **LoadDrivesInBackground** will get in handy. Setting this property to true will indicate the control to load the drives under the "This PC" node in a background thread. This way, we can reduce the loading time of the file dialogs and work with them while the engine is loading all drives.

**Load Drives in Background Thread**

```C#
RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
openFileDialog.Owner = this;
openFileDialog.LoadDrivesInBackground = true;
openFileDialog.ShowDialog();
```

## Tooltips on Trimmed Text

As of **SP R3 2022** the dialogs display a tooltip when the name of a file or folder is trimmed due to insufficient space. The tooltips close upon click.

The tooltips show the full name of the file or folder which is hovered along with some additional information:

* **For files**—The type, size and last modified date.
* **For folders**—The size and creation date.

> caption Folder name tooltip

![Folder name tooltip](https://www.telerik.com/products/wpf/documentation/assets/5e8335c91c8877ac2ebf582643704299/radfiledialogs-features-common-tooltips.png)

## Renaming Files and Folders

By default, the file dialogs allow you to rename the files and folders. To prevent the user from renaming them, set the **CanUserRename** property to **False**.

> important When the **CanUserRename** property is set to **False** the **Rename** option from the context menu will be omitted.

**Set CanUserRename to False**

```C#
RadOpenFileDialog openFileDialog = new RadOpenFileDialog();
openFileDialog.Owner = this;
openFileDialog.CanUserRename = false;
openFileDialog.ShowDialog();
```

## See Also

* [Custom Places](https://www.telerik.com/products/wpf/documentation/controls/radfiledialogs/features/custom-places)
* [Filtering](https://www.telerik.com/products/wpf/documentation/controls/radfiledialogs/features/filtering)
