Version

Add a GalleryTool to a RibbonGroup

The GalleryTool is a specialized drop-down list that can display items in a visually appealing manner to the end user. Instead of a simple list of items with a text description, the GalleryTool can display an image along with text to illustrate the application specific task(s) that the item will execute. In addition to the visual appeal of the GalleryTool, the GalleryTool can display a preview of the items that you add to its Items collection. This will allow your end users to identify the options that the GalleryTool offers simply by looking at the preview. If your end users do not see the option they want in the preview area, they can click the drop-down arrow to show a list of all available options or they can scroll the preview rows by clicking the scroll arrow thumbs right above the drop-down arrow.

You cannot add the GalleryTool directly to a RibbonGroup; you must add it to a MenuTool. However, you can only add a single instance of a GalleryTool to a MenuTool’s Items collection. If you want to display a preview of the GalleryItems, you can set the MenuTool’s ShouldDisplayGalleryPreview property to True.

The GalleryTool exposes an ItemSettings property that you can set to an instance of a GalleryItemSettings object. The settings that you specify at the GalleryTool level will control the behavior of all the GalleryItems in the GalleryTool. You can override any setting that you set at the GalleryTool level by adding a GalleryItemSettings object to an individual GalleryItem.

The following example code demonstrates how to add a GalleryTool to a RibbonGroup.

adding gallerytool to a ribbongroup in xamribbon
adding gallerytools to a ribbongroup in xamribbon

In XAML:

...
<igRibbon:MenuTool Name="menuTool1" ShouldDisplayGalleryPreview="True">
        <igRibbon:GalleryTool Id="galleryTool1" ItemBehavior="StateButton">
        <!--TODO: Add GalleryItems to the GalleryTool -->
        </igRibbon:GalleryTool>
</igRibbon:MenuTool>
...

In Visual Basic:

Imports Infragistics.Windows.Ribbon
...
Dim galleryTool1 as New GalleryTool()
galleryTool1.Id = "galleryTool1"
galleryTool1.ItemBehavior = GalleryToolItemBehavior.StateButton
Me.menuTool1.Items.Add(galleryTool1)
'TODO: Add GalleryItems to the GalleryTool
…

In C#:

using Infragistics.Windows.Ribbon;
...
GalleryTool galleryTool1 = new GalleryTool();
galleryTool1.Id = "galleryTool1";
galleryTool1.ItemBehavior = GalleryToolItemBehavior.StateButton;
this.menuTool1.Items.Add(galleryTool1);
//TODO: Add GalleryItems to the GalleryTool
...