Skip to main content
A newer version of this page is available. .
Bar

BarManager.GetNewItemId() Method

Returns the new unique identifier of an item.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v18.2.dll

Declaration

public int GetNewItemId()

Returns

Type Description
Int32

An integer value representing the unique identifier of an item within the BarManager.

Remarks

The GetNewItemId method can be used to initialize the bar item’s BarItem.Id property. This property identifies the item from amongst the other items that belong to the same BarManager. When creating bar items at runtime you need to manually set their BarItem.Id properties to allow the bars’ layout to be saved and restored correctly.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetNewItemId() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also