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


public virtual int GroupIndex { get; set; }
Public Overridable Property GroupIndex As Integer

Property Value

Type Default Description


The button's group index


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