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

Gallery Controls

  • 4 minutes to read

Several DevExpress controls can display image galleries. Some of these controls are designed to display solely image galleries, while in other controls, image galleries are only a part of the control functionality. This topic lists the available gallery controls, describes the structure of galleries and covers common gallery features.

On this page:

Online Video

RibbonControl

The Ribbon Control implements the Ribbon UI introduced in MS Office products. Beside editors, menus, regular and check buttons, the Ribbon Control can display inline and dropdown image galleries.

CD_RibbonGallery_InRibbonGalleries

Galleries in the Ribbon Control can be created using the RibbonGalleryBarItem object. See In-Ribbon Galleries to learn more.

GalleryControl

GalleryControl is a standalone image gallery control.

GalleryControl

The gallery in this control can be accessed and customized using the GalleryControl.Gallery property, which is of the GalleryControlGallery type. See the GalleryControl class description for information on features that are specific to this control. General gallery features are covered below.

PopupGalleryEdit

PopupGalleryEdit is an editor that supports a dropdown image gallery. This control can be used as an in-place editor within cells in container controls and components (e.g., GridControl, TreeList, BarManager, etc.).

PopupGalleryEdit - Overview

The editor’s value and display text are formed from the selected gallery item(s).

The gallery in this control is referred to by the RepositoryItemPopupGalleryEdit.Gallery property, which is of the PopupGalleryEditGallery type.

GalleryDropDown

GalleryDropDown is a popup gallery control, which can be displayed as a context menu. This control is also used to implement dropdown galleries in the Ribbon Control.

GalleryDropdDown

The GalleryDropDown allows custom menu items (bar items) to be displayed below the embedded gallery. In the image above, the Font Size and Font Color are custom menu items.

The gallery in this control is accessed using the GalleryDropDown.Gallery property, which is of the InDropDownGallery type.

Gallery Elements

All galleries in the DevExpress controls are derived from one ancestor - the BaseGallery class, and they have some common features. To learn about additional features provided by specific gallery controls, see the descriptions of these controls.

Structurally and visually, each gallery consists of gallery items (GalleryItem) combined into gallery item groups (GalleryItemGroup).

GalleryControl-Structure

Gallery items display images and text, while gallery item groups are tailored to separate sets of items. In some controls, gallery item group captions (GalleryItemGroup.Caption) are hidden by default. To toggle group caption visibility, use the BaseGallery.ShowGroupCaption property. To show text for gallery items, use BaseGallery.ShowItemText. See Gallery Items to learn about basic item features.

Gallery controls allow you to create their elements at design time. See the following topic to learn more.

To create gallery items at runtime, first add a gallery item group (GalleryItemGroup) to the BaseGallery.Groups collection. Then, add gallery items (GalleryItem) to this group using the GalleryItemGroup.Items collection. This approach is demonstrated in the following example.

Note

All images assigned to gallery items are loaded into memory simultaneously. So, if the volume of loaded images is too large, you may experience out-of-memory issues. If you have large images, resize them to a smaller size before assigning them to gallery items.

Common Gallery Features

The following table shows common gallery features and corresponding members, grouped by functionality.

Gallery Item View Features

Member(s)

Ability to control item image display size

BaseGallery.ImageSize, BaseGallery.FixedImageSize, BaseGallery.UseMaxImageSize

Ability to display captions and descriptions.

BaseGallery.ShowItemText

Customizable positions of items’ text relative to their images

BaseGallery.ItemImageLocation

Stretching, zooming or clipping item images

BaseGallery.ItemImageLayout

Tooltips

GalleryItem.Hint, GalleryItem.SuperTip

Hover images

BaseGallery.AllowHoverImages

Layout

Customizing item layout options.

Some options are only applicable in the GalleryControl.

BaseGallery.ColumnCount, BaseGallery.FirstItemVertAlignment, BaseGallery.LastItemVertAlignment, BaseGallery.DistanceBetweenItems,

BaseGallery.DistanceItemCaptionToDescription, BaseGallery.DistanceItemImageToText

GalleryControlGallery.AutoFitColumns, GalleryControlGallery.ContentHorzAlignment

Changing the orientation from vertical to horizontal.

Supported only by the GalleryControl.

GalleryControlGallery.Orientation

Custom commands shown below the gallery.

Supported only by the GalleryDropDown.

PopupMenuBase.ItemLinks

Gallery Item Group Features

Ability to display group captions

BaseGallery.ShowGroupCaption, GalleryItemGroup.Caption

Custom controls within group captions

Supported only by the GalleryControl.

GalleryItemGroup.CaptionControl

Filtering groups using a context menu.

Not supported by In-Ribbon Galleries.

StandaloneGallery.AllowFilter

Customizing the group filter context menu.

Not supported by In-Ribbon Galleries.

BaseGallery.FilterMenuPopup

Behavior

Multiple item checking/selection modes

BaseGallery.ItemCheckMode, BaseGallery.AllowMarqueeSelection, BaseGallery.GetCheckedItems, BaseGallery.ClearSelectionOnClickEmptySpace,

BaseGallery.CheckDrawMode

Standard and smooth scrolling

BaseGallery.ScrollMode and StandaloneGallery.UseOptimizedScrolling

Responding to item clicking, checking and double-clicking

BaseGallery.ItemClick, BaseGallery.ItemCheckedChanged and BaseGallery.ItemDoubleClick

Appearance

Ability to specify a background image and appearance settings for the control

BaseGallery.Appearance and GalleryControlGallery.BackgroundImage

Custom drawing of gallery item images

BaseGallery.CustomDrawItemImage

Custom drawing of gallery item captions

BaseGallery.CustomDrawItemText

See Also