Skip to content

DevExpress-Examples/winforms-file-explorer-breadcrumb-folder-nav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinForms Breadcrumb Editor - Create a folder navigation bar (File Explorer)

This example demonstrates how to use the WinForms Breadcrumb Editor to create a folder navigation bar inspired by Microsoft Windows File Explorer.

WinForms Breadcrumb Editor - Create a folder navigation bar

Two root nodes ('Root' and 'Computer') are created at design time. Their BreadCrumbNode.Persistent and BreadCrumbNode.PopulateOnDemand properties are set to true. The Root node stores shortcuts to most important directories (Desktop, Windows, Program Files). The Computer node allows users to quickly navigate through local disks via related shortcuts.

void InitBreadCrumbRootNode(BreadCrumbNode node) {
    node.ChildNodes.Add(new BreadCrumbNode("Desktop", Environment.GetFolderPath(Environment.SpecialFolder.Desktop)));
    node.ChildNodes.Add(new BreadCrumbNode("Windows", Environment.GetFolderPath(Environment.SpecialFolder.Windows)));
    node.ChildNodes.Add(new BreadCrumbNode("Program Files", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)));
}
void InitBreadCrumbComputerNode(BreadCrumbNode node) {
    foreach (DriveInfo driveInfo in GetFixedDrives()) {
        node.ChildNodes.Add(new BreadCrumbNode(driveInfo.Name, driveInfo.RootDirectory));
    }
}

The following events are handled to dynamically generate the Nodes tree according to the folder structure:

Files to Review

Documentation

See Also