Back to Devexpress

DXFolderBrowserDialog.RootFolder Property

wpf-devexpress-dot-xpf-dot-dialogs-dot-dxfolderbrowserdialog.md

latest2.6 KB
Original Source

DXFolderBrowserDialog.RootFolder Property

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

Declaration

csharp
public Environment.SpecialFolder RootFolder { get; set; }
vb
Public Property RootFolder As Environment.SpecialFolder

Property Value

TypeDescription
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.

csharp
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();
}
vb
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

DXFolderBrowserDialog Class

DXFolderBrowserDialog Members

DevExpress.Xpf.Dialogs Namespace