Skip to main content

TcxEditRepositoryRadioGroupItem Class

Declaration

TcxEditRepositoryRadioGroupItem = class(
    TcxEditRepositoryItem
)

Remarks

A radio group is a container for radio buttons that allows users to switch between available options.

VCL Editors Library: A Radio Group Example

The TcxEditRepositoryRadioGroupItem class overrides the Properties property that allows you to access and customize radio group settings.

Edit Repository Items and Standalone Editors

Edit repository items are useful when you need to share the same settings between multiple editors of the same type. To accomplish this goal, you can assign the same edit repository item to RepositoryItem properties of all target editors.

Edit Repository Items and Container Controls

A container control item (such as a toolbar edit item or a column (or any other data item) in a Data Grid, Vertical Grid, or Tree List control) can embed an in-place editor shipped with the ExpressEditors Library. An in-place editor exists (and, therefore, has its own WinAPI handle) only when the target container control item is being edited. Otherwise, the container control item displays a static editor image for resource usage optimization.

VCL Tree List: An In-Place Date Editor

Create a Radio Group Repository Item at Design Time

To create a radio group repository item at design time, double-click a TcxEditRepository component to invoke its collection editor.

VCL Editors Library: An Edit Repository Collection Editor

The collection editor dialog allows you to manage repository items. Click the Add… button to invoke a repository item creation dialog.

VCL Editors Library: An Edit Repository Item Creation Dialog

Select the RadioGroup item and click the Ok button to create a radio group repository item.

Create a Radio Group Repository Item in Code

The following code example creates a radio group repository item, defines three grouped radio buttons, and assigns the created repository item to two existing unbound radio groups:

uses cxEdit, cxEditRepositoryItems;
// ...
var
  ARadioGroupRepositoryItem: TcxEditRepositoryRadioGroupItem;
  ARepositoryItem: TcxEditRepositoryItem;
  ARadioGroupItem: TcxRadioGroupItem;
begin
  ARepositoryItem := cxEditRepository1.CreateItem(TcxEditRepositoryRadioGroupItem);
  ARadioGroupRepositoryItem := ARepositoryItem as TcxEditRepositoryRadioGroupItem;
  // Creates three radio buttons
  ARadioGroupItem := ARadioGroupRepositoryItem.Properties.Items.Add;
  ARadioGroupItem.Caption := 'Circle';
  ARadioGroupItem := ARadioGroupRepositoryItem.Properties.Items.Add;
  ARadioGroupItem.Caption := 'Rectangle';
  ARadioGroupItem := ARadioGroupRepositoryItem.Properties.Items.Add;
  ARadioGroupItem.Caption := 'Ellipse';
  // Assigns the created repository item to two existing unbound radio groups
  cxRadioGroup1.RepositoryItem := ARadioGroupRepositoryItem;
  cxRadioGroup2.RepositoryItem := ARadioGroupRepositoryItem;
end;

Radio Group Repository Item Deletion

To delete all radio group repository items in a TcxEditRepository component, call its RemoveItems procedure and pass a reference to the TcxEditRepositoryRadioGroupItem class as a parameter.

If you need to delete an individual radio group repository item, release it directly in code (call the Free procedure in Delphi or use the delete keyword in C++Builder).

Inheritance

See Also