wpf-devexpress-dot-xpf-dot-dialogs-dot-dxfolderbrowserdialog.md
Gets or sets the root folder from which the navigation starts.
Namespace : DevExpress.Xpf.Dialogs
Assembly : DevExpress.Xpf.Dialogs.v25.2.dll
NuGet Package : DevExpress.Wpf.Dialogs
public Environment.SpecialFolder RootFolder { get; set; }
Public Property RootFolder As Environment.SpecialFolder
| Type | Description |
|---|---|
| Environment.SpecialFolder |
A System.Environment+SpecialFolder object that specifies the folder from which the navigation starts.
|
Only the specified folder and any subfolders that are beneath it will appear in the dialog box and be selectable.
The DXFolderBrowserDialog.SelectedPath property, along with RootFolder , determines what the selected folder will be when the dialog box is displayed, as long as DXFolderBrowserDialog.SelectedPath is an absolute path that is a subfolder of RootFolder (or more accurately, points to a subfolder of the shell namespace represented by RootFolder ).
The code sample below illustrates how to make DXFolderBrowserDialog navigate starting with the “Program Files: folder.
private void button_Click(object sender, RoutedEventArgs e) {
var fileDialog = new DXFolderBrowserDialog();
fileDialog.Description = "Select the folder you want to open:";
fileDialog.RootFolder = Environment.SpecialFolder.ProgramFiles;
fileDialog.ShowDialog();
}
Private Sub button_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim fileDialog = New DXFolderBrowserDialog()
fileDialog.Description = "Select the folder you want to open:"
fileDialog.RootFolder = Environment.SpecialFolder.ProgramFiles
fileDialog.ShowDialog()
End Sub
See Also