Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

CheckButton.GroupIndex Property

Gets or sets the button’s group index. Within a group, only one button may be checked at a time. When users click another button in a group, the checked state moves from the current button to the clicked one.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DefaultValue(-1)]
[DXCategory("Behavior")]
public virtual int GroupIndex { get; set; }

#Property Value

Type Default Description
Int32 -1

A non-negative integer value that specifies the button’s group index. -1 to exclude the button from groups.

#Remarks

To combine buttons into a logical group, set their GroupIndex properties to the same non-negative value. If the GroupIndex property is set to -1, the button does not belong to any group.

The code sample below illustrates how to group several check buttons into two groups:

checkButtonWantsToImprove.GroupIndex = 0;
checkButtonDoesntWantToImprove.GroupIndex = 0;
checkButtonStudentLevelBeginner.GroupIndex = 1;
checkButtonStudentLevelIntermediate.GroupIndex = 1;
checkButtonStudentLevelAdvanced.GroupIndex = 1;

To allow users to uncheck the checked button, set its CheckButton.AllowAllUnchecked property to true.

To respond to a button’s state change, handle the CheckButton.CheckedChanged event.

See Also