Skip to main content

DXFolderBrowserDialog.RootFolder Property

Gets or sets the root folder from which the navigation starts.

Namespace: DevExpress.Xpf.Dialogs

Assembly: DevExpress.Xpf.Dialogs.v24.1.dll

NuGet Package: DevExpress.Wpf.Dialogs

Declaration

public Environment.SpecialFolder RootFolder { get; set; }

Property Value

Type Description
Environment.SpecialFolder

A System.Environment+SpecialFolder object that specifies the folder from which the navigation starts.

Remarks

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();
}
See Also