windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitembreadcrumbedit-ab033e09.md
Occurs each time a new node is about to be added to the BreadCrumbEdit.
Namespace : DevExpress.XtraEditors.Repository
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DXCategory("Events")]
public event BreadCrumbNewNodeAddingEventHandler NewNodeAdding
<DXCategory("Events")>
Public Event NewNodeAdding As BreadCrumbNewNodeAddingEventHandler
The NewNodeAdding event's data class is DevExpress.XtraEditors.BreadCrumbNewNodeAddingEventArgs.
When a BreadCrumbEdit has to navigate to an unknown BreadCrumbEdit.Path, it raises the ValidatePath event. Handle this event to disable the navigation or enable it and create required nodes.
If you choose to create the nodes, the BreadCrumbEdit raises the NewNodeAdding event. This event allows you to customize a new node specified by the e.Node parameter. Use the e.Value parameter to obtain a node value.
private void breadCrumbEdit1_Properties_ValidatePath(object sender, DevExpress.XtraEditors.BreadCrumbValidatePathEventArgs e) {
if (e.Path == "Node 1\\Node 2\\Node 3") e.ValidationResult = DevExpress.XtraEditors.BreadCrumbValidatePathResult.CreateNodes;
else e.ValidationResult = DevExpress.XtraEditors.BreadCrumbValidatePathResult.Cancel;
}
private void breadCrumbEdit1_Properties_NewNodeAdding(object sender, DevExpress.XtraEditors.BreadCrumbNewNodeAddingEventArgs e) {
e.Node.Caption = "My Node 1";
. . .
e.Node.PopulateOnDemand = true;
}
Private Sub breadCrumbEdit1_Properties_ValidatePath(sender As Object, e As DevExpress.XtraEditors.BreadCrumbValidatePathEventArgs)
If e.Path = "Node 1\Node 2\Node 3" Then
e.ValidationResult = DevExpress.XtraEditors.BreadCrumbValidatePathResult.CreateNodes
Else
e.ValidationResult = DevExpress.XtraEditors.BreadCrumbValidatePathResult.Cancel
End If
End Sub
Private Sub breadCrumbEdit1_Properties_NewNodeAdding(sender As Object, e As DevExpress.XtraEditors.BreadCrumbNewNodeAddingEventArgs)
e.Node.Caption = "My Node 1"
. . .
e.Node.PopulateOnDemand = True
End Sub
Finally, the RepositoryItemBreadCrumbEdit.QueryChildNodes event fires. This event allows you to dynamically populate the newly created node’s BreadCrumbNode.ChildNodes collection.
Read the following topic for detailed information: Breadcrumb Edit Control.
See Also
RepositoryItemBreadCrumbEdit Class