Back to Devexpress

GalleryItem.Checked Property

windowsforms-devexpress-dot-xtrabars-dot-ribbon-dot-galleryitem-137598fd.md

latest3.7 KB
Original Source

GalleryItem.Checked Property

Gets or sets whether the item is checked.

Namespace : DevExpress.XtraBars.Ribbon

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(false)]
public bool Checked { get; set; }
vb
<DefaultValue(False)>
Public Property Checked As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true if the item is checked; otherwise, false.

|

Remarks

A gallery item can have two states: normal (elevated) and pressed. The Checked property specifies the item’s state. The item’s state is not toggled automatically on a click.

You can enable automatic item checking on a click, via the BaseGallery.ItemCheckMode property. With this feature enabled, a click on a gallery item automatically changes its check state via the Checked property.

It’s also possible to implement manual item checking. For instance, you can handle the BaseGallery.ItemClick event, and manipulate an item’s Checked setting according to your logic.

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

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-reporting-add-ai-options-to-report-wizard/CS/Customization/ChooseReportCreationModePageView.cs#L42

csharp
void OnItemCheckedChanged(object sender, GalleryItemEventArgs e) {
    if(!e.Item.Checked)
        return;

winforms-reporting-add-ai-options-to-report-wizard/VB/Customization/ChooseReportCreationModePageView.vb#L57

vb
Private Sub OnItemCheckedChanged(ByVal sender As Object, ByVal e As GalleryItemEventArgs)
    If Not e.Item.Checked Then Return
    RaiseEvent CreationModeChanged(Me, EventArgs.Empty)

See Also

ItemClick

ItemCheckMode

SetItemCheck

SynchWithInRibbonGallery

GalleryItem Class

GalleryItem Members

DevExpress.XtraBars.Ribbon Namespace