Skip to main content
A newer version of this page is available. .

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.v19.1.dll

Declaration

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

Property Value

Type Default Description
Int32 -1

The button’s group index

Remarks

To combine buttons into a logical group, set their GroupIndex properties to the same non-negative value. If the GroupIndex propert is set to -1, this button doesn’t belong to any group.

If you want users to be able to uncheck a checked button, set its CheckButton.AllowAllUnchecked property to true. The default value of this property is false.

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

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

checkButtonStudentLevelBeginner.GroupIndex = 1;
checkButtonStudentLevelIntermediate.GroupIndex = 1;
checkButtonStudentLevelAdvanced.GroupIndex = 1;

checkButtonWantsToImprove.GroupIndex = 2;
checkButtonDoesntWantToImprove.GroupIndex = 2;
See Also