Skip to main content
Bar

BarItem.MergeType Property

Gets or sets how the item behaves during merge operations in MDI applications.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DefaultValue(BarMenuMerge.Add)]
[DXCategory("Behavior")]
public BarMenuMerge MergeType { get; set; }

Property Value

Type Default Description
BarMenuMerge Add

A BarMenuMerge value specifying how the bar item behaves during merge operations.

Available values:

Name Description
Add

Specifies that the child form’s bar item should be added to a bar/Ribbon Control or container item (e.g. menu) of a parent form.

When merging bars and container items, the position to insert the item is determined by the BarItem.MergeOrder properties of this item and of the items within the target bar/container item.

Replace

Indicates that the child form’s bar item should replace the parent form’s item that has the same BarItem.Caption, but only if the parent item’s BarItem.MergeType property is also set to Replace.

If such an item is not found in the parent form’s bar/RibbonControl, the child form’s item will simply be added to the bar/Ribbon Control (similar to the BarMenuMerge.Add setting).

MergeItems

This setting is applied to container items (BarCustomContainerItem descendants).

It specifies that subitems of the child form’s container item should be merged with subitems of a parent form’s container item. Merging occurs for the parent form’s container item, whose type and BarItem.Caption match the source item’s ones and only if its BarItem.MergeType property is also set to MergeItems. Otherwise, the child form’s container item will simply be added to the parent form’s bar/Ribbon Control (similar to the BarMenuMerge.Add setting).

Remove

For a child form’s bar item, indicates that the item must not be added to the parent form’s bar/Ribbon Control during merging.

For a parent form’s bar item, indicates that the item must be removed from the bar/Ribbon Control during merging.

Remarks

During merging, the bar item links of a child MDI form are added to a bar of the parent MDI form. The MergeType property specifies how bar items behave during merging. You can specify whether the bar items of a child form’s bar should be added to the parent form’s bar (this is the default behavior), should replace the bar items on the parent form with identical captions, should simply be removed from the bar or should not be considered at all. Refer to the BarMenuMerge type description for more information.

The MDI Merging document covers information related to merging bars.

See Also