Skip to main content
Bar

BarItemLink.ActAsButtonGroup Property

Gets or sets whether the bar item link is arranged in the same manner as a BarButtonGroup object. This property is only in effect within a RibbonControl.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Behavior")]
[SupportedByBarManager(SupportedByBarManagerKind.NonSupported)]
[XtraSerializableProperty]
public virtual bool ActAsButtonGroup { get; set; }

Property Value

Type Description
Boolean

true if the bar item link is arranged using the Button Group Layout; false, if the bar item link is arranged using the regular layout.

Remarks

Bar items can be arranged within a Ribbon page group using the regular layout or the Button Group layout. Use the ActAsButtonGroup property to specify how bar item links must be arranged.

  • Regular Layout (default)

    If bar items have the ActAsButtonGroup property set to false, they are arranged using the regular layout. In this mode, they are arranged in columns, down then across. Each column can contain one to three bar items. A column’s width is determined by the widest bar item in this column.

    With this layout, if item links in a column have different widths, you’ll notice a gap between items in this and the next column.

  • Button Group Layout

    If the current and adjacent bar item links have the ActAsButtonGroup property set to true, they are arranged in the same way as BarButtonGroup objects. They are arranged across then down, wrapping automatically to fill the available space optimally, without gaps.

The following image illustrates these two layouts. For all bar item links in these images, the ActAsButtonGroup property is set to a corresponding value.

ActAsButtonGroupModel

Example

The following example shows how to apply the Button Group layout to a set of bar item links. The Button Group layout is enabled via the BarItemLink.ActAsButtonGroup property.

using DevExpress.XtraBars;

BarButtonItem[] items = new BarButtonItem[] {barButtonItem1, barButtonItem2, barButtonItem3 };

foreach (BarButtonItem item in items) {
    item.Links[0].ActAsButtonGroup = true;
}
See Also