Version

Add a ToolHorizontalWrapPanel to a RibbonGroup

The ToolHorizontalWrapPanel arranges its tools into rows based on the MinRows and MaxRows property values. The ToolHorizontalWrapPanel tries to fit all of its tools into the minimum number of rows; however, if the tools will not fit in the minimum number of rows, the ToolHorizontalWrapPanel uses an extra row to rearrange its tools. The ToolHorizontalWrapPanel never decreases the number of rows below the value of the MinRows property nor does it increase the number of rows above the value of the MaxRows property.

Note
Note

If you set the MaximumSize attached property on a tool to ImageAndTextLarge, that tool will be placed at the beginning of the panel in its own column and will not be resized by the panel.

The default layout panel that a RibbonGroup uses to arrange tools is the ToolVerticalWrapPanel. If you want the functionality of a ToolHorizontalWrapPanel, you have to add an instance of a ToolHorizontalWrapPanel to the RibbonGroup before you add any tools.

In XAML:

...
<igRibbon:RibbonGroup Name="group1" Caption="Group 1">
        <igRibbon:ToolHorizontalWrapPanel>
                <igRibbon:ButtonTool
                        Id="btnTool1"
                        Caption="Button Tool 1" />
        <!--TODO: Add more Ribbon tools here-->
        </igRibbon:ToolHorizontalWrapPanel>
</igRibbon:RibbonGroup>
...

In Visual Basic:

Imports Infragistics.Windows.Ribbon
...
Dim horizontalWrapPanel As New ToolHorizontalWrapPanel()
Me.group1.Items.Add(horizontalWrapPanel)
Dim btnTool1 As New ButtonTool()
btnTool1.Id = "btnTool1"
btnTool1.Caption = "Button Tool 1"
horizontalWrapPanel.Children.Add(btnTool1)
'TODO: Add more Ribbon tools to the ToolHorizontalWrapPanel's Children collection
...

In C#:

using Infragistics.Windows.Ribbon;
...
ToolHorizontalWrapPanel horizontalWrapPanel = new ToolHorizontalWrapPanel();
this.group1.Items.Add(horizontalWrapPanel);
ButtonTool btnTool1 = new ButtonTool();
btnTool1.Id = "btnTool1";
btnTool1.Caption = "Button Tool 1";
horizontalWrapPanel.Children.Add(btnTool1);
//TODO: Add more Ribbon tools to the ToolHorizontalWrapPanel's Children collection.
...