CheckButton.GroupIndex Property
Gets or sets the group index. Buttons with the same non-negative group index form a mutually exclusive group.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v25.2.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
Property Value
| Type | Default | Description |
|---|---|---|
| Int32 | -1 | A non-negative integer value that specifies the button’s group index. -1 excludes the button from all groups. |
Remarks
Assign the same non-negative integer to the GroupIndex property of multiple CheckButton controls to combine them into a mutually exclusive group. Within a group, only one button can be checked at a time. When a user clicks an unchecked button, the previously checked button is unchecked automatically.
Set GroupIndex to -1 to exclude a button from all groups.
The following code snippet groups multiple CheckButton controls 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.
Handle the CheckButton.CheckedChanged event to respond to state changes.