Skip to main content

RepositoryItemPopupGalleryEdit.Gallery Property

Gets the gallery used in the PopupGalleryEdit control.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraBars.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Behavior")]
public PopupGalleryEditGallery Gallery { get; }

Property Value

Type Description
PopupGalleryEditGallery

The gallery used in the PopupGalleryEdit control.

Remarks

The Gallery property contains the PopupGalleryEditGallery object that is displayed in the PopupGalleryEdit popup window. The PopupGalleryEditGallery contains gallery items (GalleryItem) combined into gallery item groups (GalleryItemGroup). Via this property, you can get the PopupGalleryEditGallery object to specify its settings and manipulate gallery groups and items.

To customize PopupGalleryEditGallery at design time, you can use the Gallery Designer. To open the Gallery Designer, click the PopupGalleryEdit‘s smart tag Common_SmartTag and click the Edit Gallery link.

PopupGalleryEdit_GalleryEditGalleryDesigner

Example

The following example shows how to customize the Popup Gallery Edit in code, using properties of the PopupGalleryEditGallery object that is accessed via the RepositoryItemPopupGalleryEdit.Gallery property.

In this example, multiple item selection is enabled and the gallery is set to display item captions and descriptions. Newly created gallery items are combined into the group and this group is added into the collection of gallery item groups.

using DevExpress.XtraBars.Ribbon.Gallery;
using DevExpress.XtraEditors;

// Specify item selection mode. 
popupGalleryEdit1.Properties.Gallery.ItemCheckMode = ItemCheckMode.Multiple;

// Enable item captions and descriptions showing. 
popupGalleryEdit1.Properties.Gallery.ShowItemText = true;

// Create gallery items and add them to the newly created gallery item group. 
GalleryItem gi1 = new GalleryItem();
gi1.Caption = "Item1";
gi1.Description = "Item1 description";
GalleryItem gi2 = new GalleryItem();
gi2.Caption = "Item2";
gi2.Description = "Item2 description";
GalleryItemGroup gig = new GalleryItemGroup();
gig.Caption = "Gallery group";
gig.Items.Add(gi1);
gig.Items.Add(gi2);
// Add this group to the group collection of the gallery 
// that is displayed in the PopupGalleryEdit popup window. 
popupGalleryEdit1.Properties.Gallery.Groups.Add(gig);
See Also