Skip to main content

RadioGroupItemCollection.Add(RadioGroupItem) Method

Adds a new item to the current radio group collection.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual void Add(
    RadioGroupItem item
)

Parameters

Name Type Description
item RadioGroupItem

The RadioGroupItem object representing the new item in the collection.

Remarks

The Add method adds a new item at the end of the current collection. The object representing the item is passed as the item parameter. Whenever you select an item in the radio group editor, the RadioGroup.SelectedIndex property value is set to the corresponding object’s index within the RepositoryItemRadioGroup.Items collection.

To add several objects at once, see the RadioGroupItemCollection.AddRange method. To insert an object at a specified position, use the RadioGroupItemCollection.Insert method.

To remove an item from the collection, use the RadioGroupItemCollection.Remove method.

Note: to ensure proper functionality of the editor, items in the RepositoryItemRadioGroup.Items collection must be unique objects.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Add(RadioGroupItem) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also