Skip to main content

RepositoryItemCheckEdit.RadioGroupIndex Property

Gets or sets the index of a logical radio group to which the check editor belongs.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

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

Property Value

Type Default Description
Int32 -1

An integer value specifying the non-negative index of a logical radio group owning the check editor.

Remarks

When a check editor is used as a standalone control (i.e, it is not embedded into another control, e.g. XtraGrid), it can function like a standard radio button. Use the RadioGroupIndex property to switch a check editor into this mode. You need a logical group of check editors functioning as radio buttons for this mode to make sense. Since radio buttons are mutually exclusive, a check editor functioning in radio button mode can accept only two states - checked or unchecked. When the user selects a check editor within the group, it is set as checked and the others are unchecked automatically.

To define a logical group of radio-like check editors located within a container, such as a Form, GroupBox or Panel, you should set their RadioGroupIndex property to the same non-negative integer. To create multiple groups on one form, place each group in its own container (GroupBox or Panel) or set the RadioGroupIndex property of the group members to a unique value. Note: check editors located in different containers may have an identical value of the RadioGroupIndex property, but will belong to different groups depending on their container.

Assigning a new value to the RadioGroupIndex property at runtime generates the RepositoryItem.PropertiesChanged event.

In general, radio button and check edit operation modes have a similar function: they offer choices a user can select or clear. They differ in that multiple check edit controls can be selected at the same time, but radio buttons are mutually exclusive. You can use the RepositoryItemCheckEdit.IsRadioButton property to find out whether a check editor functions like a radio button.

Note

Check edit controls combined into a RadioGroup via the RadioGroupIndex property can only be used in unbound mode. Do not use them in data binding. Binding multiple check editors to the same field in a data source may have unpredictable results.

Tip

You can also use the WinForms RadioGroup control to display a group of radio buttons. Use RepositoryItemRadioGroup to display radio button groups within cells of data-aware controls (for example, WinForms Data Grid, TreeList, Vertical Grid).

See Also