[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Collapse]Editors and Simple Controls
    Included Controls and Components
   [Expand]Common Editor Features and Concepts
   [Expand]Lookup Editors
    Popup Container Editor
   [Expand]Token Edit Control
   [Collapse]Breadcrumb Edit Control
     Breadcrumb Modes
     How to: Create Breadcrumb Nodes at Design Time
     How to: Create Breadcrumb Nodes at Runtime
     How To: Add Custom Buttons to the Breadcrumb Edit Control
     How To: Create a File Explorer
   [Expand]Range Control
   [Expand]Image Slider
    Camera Control
    Templated ListBox Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Create Breadcrumb Nodes at Runtime

This example illustrates how to populate the BreadCrumbEdit control with nodes in code.

Expanded Dynamic Population

This method is based on handling control and node events.

  1. Set the BreadCrumbEdit.Path property that will reflect the path from the root node to the last visible node. This path will be the start-up path for your Breadcrumb Edit Control.

  2. Nodes 1, 2 and 3 were not created at runtime, so the BreadCrumbEdit cannot navigate through them, and it raises the RepositoryItemBreadCrumbEdit.ValidatePath event. Handle this event to create new nodes or cancel the navigation. In this case, Nodes 1, 2 and 3 need to be created.

  3. Your path is now valid and the RepositoryItemBreadCrumbEdit.NewNodeAdding event is raised. This event indicates that a new node is about to be added. Handle this event to customize the new node properties. Note that you should set the BreadCrumbNode.PopulateOnDemand property to true for all nodes that should have child nodes within.

  4. Finally, when an end-user expands any of the newly created nodes to view its child nodes, the RepositoryItemBreadCrumbEdit.QueryChildNodes event will fire. Handle this event to dynamically populate the BreadCrumbNode.ChildNodes collection.

Expanded Static Node Collection

The code below illustrates a simplified approach where you create the BreadCrumbNode class instances and add them to the RepositoryItemBreadCrumbEdit.Nodes and BreadCrumbNode.ChildNodes collections.

Is this topic helpful?​​​​​​​