RadioGroup
TsgcHTMLComponent_RadioGroup — a group of mutually exclusive radio options with a label and stacked or inline layout that renders Bootstrap 5 form-check radios, in Delphi, C++ Builder and .NET.
TsgcHTMLComponent_RadioGroup — a group of mutually exclusive radio options with a label and stacked or inline layout that renders Bootstrap 5 form-check radios, in Delphi, C++ Builder and .NET.
A standalone single-choice input that emits a set of Bootstrap form-check radios sharing one Name. Add the option captions to Items, pick a SelectedIndex, then read the HTML property. It ships in the same unit as the sibling Edit, Memo and CheckBox inputs.
TsgcHTMLComponent_RadioGroup
Bootstrap 5 form-check radios
Delphi, C++ Builder, .NET
Set Name and Label_, add captions to the Items string list, choose a SelectedIndex, then read HTML (or drop it into a TsgcHTMLTemplate_Bootstrap page).
uses
sgcHTML_Component_Edit;
var
oRadio: TsgcHTMLComponent_RadioGroup;
begin
oRadio := TsgcHTMLComponent_RadioGroup.Create(nil);
try
oRadio.Name := 'plan';
oRadio.Label_ := 'Choose a plan';
oRadio.Items.Add('Free');
oRadio.Items.Add('Pro');
oRadio.Items.Add('Enterprise');
oRadio.SelectedIndex := 1;
oRadio.InlineLayout := True;
WebModule.Response := oRadio.HTML; // Bootstrap form-check radios
finally
oRadio.Free;
end;
end;
// includes: sgcHTML_Component_Edit.hpp
TsgcHTMLComponent_RadioGroup *oRadio = new TsgcHTMLComponent_RadioGroup(NULL);
try
{
oRadio->Name = "plan";
oRadio->Label_ = "Choose a plan";
oRadio->Items->Add("Free");
oRadio->Items->Add("Pro");
oRadio->Items->Add("Enterprise");
oRadio->SelectedIndex = 1;
oRadio->InlineLayout = true;
String html = oRadio->HTML; // Bootstrap form-check radios
}
__finally
{
delete oRadio;
}
using esegece.sgcWebSockets;
var radio = new TsgcHTMLComponent_RadioGroup();
radio.Name = "plan";
radio.Label_ = "Choose a plan";
radio.Items.Add("Free");
radio.Items.Add("Pro");
radio.Items.Add("Enterprise");
radio.SelectedIndex = 1;
radio.InlineLayout = true;
string html = radio.HTML; // Bootstrap form-check radios
The members you reach for most often.
Name is shared by every radio so they form one group, Label_ is the group caption and RadioGroupID seeds the per-option element ids (defaults to rg_<Name>).
Items is a TStringList — add one caption per choice with Items.Add; each entry becomes a radio whose value is the caption text.
SelectedIndex marks the pre-checked option (default -1, none selected).
InlineLayout lays the radios out horizontally with form-check-inline; leave it off for a stacked list.
Disabled greys out the whole group.
HTML returns the labelled radio group. The same unit declares the sibling TsgcHTMLComponent_Edit, TsgcHTMLComponent_Memo and TsgcHTMLComponent_CheckBox inputs.