Skip to main content

NavBarViewBase.ItemAdding Event

Occurs after an item has been implicitly created and bound to a data source, but prior to adding it to the NavBar control.

Namespace: DevExpress.Xpf.NavBar

Assembly: DevExpress.Xpf.NavBar.v24.1.dll

NuGet Package: DevExpress.Wpf.NavBar

Declaration

public event ItemAddingEventHandler ItemAdding

Event Data

The ItemAdding event's data class is ItemAddingEventArgs. The following properties provide information specific to this event:

Property Description
Item Gets an item object related to the event.
SourceObject Gets the data item to which the event related element (a group or item) is bound. Inherited from ElementAddingEventArgs.

Remarks

The ItemAdding event is raised for each item after it’s data bound to the corresponding data from the data source specified via the NavBarControl.ItemsSource property. This event enables you to customize settings of the related item before it is finally added to a NavBar group’s NavBarGroup.Items collection, which cannot be explicitly modified for a data bound NavBar control. Handling the ItemAdding event correctly, you can for example, implement a custom logic to dynamically map properties of a NavBar control’s items to the required data fields.

The processed NavBar item and its corresponding data source item can be accessed by using the ItemAddingEventArgs.Item and ElementAddingEventArgs.SourceObject properties of the event’s argument, respectively.

If the NavBar control functions in unbound mode, the ItemAdding event isn’t raised.

See Also