Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DXFolderBrowserDialog.RootFolder Property

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

Namespace: DevExpress.Xpf.Dialogs

Assembly: DevExpress.Xpf.Dialogs.v24.2.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