Back to Devexpress

BaseGallery.GetCheckedItems() Method

windowsforms-devexpress-dot-xtrabars-dot-ribbon-dot-gallery-dot-basegallery-6c1abf0c.md

latest3.8 KB
Original Source

BaseGallery.GetCheckedItems() Method

Returns a list containing the currently checked (selected) gallery items.

Namespace : DevExpress.XtraBars.Ribbon.Gallery

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public List<GalleryItem> GetCheckedItems()
vb
Public Function GetCheckedItems As List(Of GalleryItem)

Returns

TypeDescription
List<GalleryItem>

A list that contains checked (selected) gallery items.

|

Remarks

Checked items are those whose GalleryItem.Checked properties are set to true. To allow items to be checked by an end-user, use the BaseGallery.ItemCheckMode property.

The GetCheckedItems method returns items that are checked within all gallery groups. If there is no checked item, the method returns an empty list.

To get items that are checked within specific groups, use GalleryItemGroup.GetCheckedItems.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetCheckedItems() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-gallerycontrol-drag-drop-items/CS/DragDropExample/DragDropHelper.cs#L63

csharp
GalleryControl gallery = (GalleryControl)sender;
List<GalleryItem> checkedItems = gallery.Gallery.GetCheckedItems();
if (checkedItems.Count == 0)

winforms-gallerycontrol-drag-drop-items/VB/DragDropExample/DragDropHelper.vb#L63

vb
Dim gallery As GalleryControl = CType(sender, GalleryControl)
Dim checkedItems As List(Of GalleryItem) = gallery.Gallery.GetCheckedItems()
If checkedItems.Count = 0 Then

See Also

Checked

GetAllItems()

GetVisibleItems()

ItemCheckMode

AllowMarqueeSelection

GetCheckedItems()

BaseGallery Class

BaseGallery Members

DevExpress.XtraBars.Ribbon.Gallery Namespace