Skip to main content
Bar

BarItemLinkCollection.Insert(Int32, BarItem) Method

Creates a new link to the specified bar item and adds it to the specified position within the collection.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual BarItemLink Insert(
    int position,
    BarItem item
)

Parameters

Name Type Description
position Int32

A zero-based integer specifying the new bar item link’s position within the collection.

item BarItem

A BarItem descendant for which the link is created and added the collection.

Returns

Type Description
BarItemLink

A BarItemLink object representing the link inserted.

Remarks

The Insert method inserts a new link at the specified position by moving all successive links to the end of the collection. If position equals the number of links in the collection, the link is appended to the end.

Note: a bar item must belong to the BarManager’s BarManager.Items collection so that a link to it can be created and added to the collection. Otherwise, an exception will be raised.

See Also