Skip to main content

RepositoryItemBreadCrumbEdit.NewNodeAdding Event

Occurs each time a new node is about to be added to the BreadCrumbEdit.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Events")]
public event BreadCrumbNewNodeAddingEventHandler NewNodeAdding

Event Data

The NewNodeAdding event's data class is DevExpress.XtraEditors.BreadCrumbNewNodeAddingEventArgs.

Remarks

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;
}

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