ASP.NET Syntax ASP.NET Syntax for Web Controls
Creates a group of radio buttons that can be dynamically generated by binding to a data source.
Declarative Syntax
<asp:RadioButtonList
AccessKey = "string"
AppendDataBoundItems = "True | False"
AutoPostBack = "True | False"
BackColor = "color name | #dddddd"
BorderColor = "color name | #dddddd"
BorderStyle = "NotSet | None | Dotted | Dashed | Solid | Double | Groove |
Ridge | Inset | Outset"
BorderWidth = size
CausesValidation = "True | False"
CellPadding = integer
CellSpacing = integer
CssClass = "string"
DataMember = "string"
DataSource = "string"
DataSourceID = "string"
DataTextField = "string"
DataTextFormatString = "string"
DataValueField = "string"
Enabled = "True | False"
EnableTheming = "True | False"
EnableViewState = "True | False"
Font-Bold = "True | False"
Font-Italic = "True | False"
Font-Names = "string"
Font-Overline = "True | False"
Font-Size = "string | Smaller | Larger | XX-Small | X-Small | Small |
Medium | Large | X-Large | XX-Large"
Font-Strikeout = "True | False"
Font-Underline = "True | False"
ForeColor = "color name | #dddddd"
Height = size
ID = "string"
OnDataBinding = "DataBinding event handler"
OnDataBound = "DataBound event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnSelectedIndexChanged = "SelectedIndexChanged event handler"
OnTextChanged = "TextChanged event handler"
OnUnload = "Unload event handler"
RepeatColumns = integer
RepeatDirection = "Horizontal | Vertical"
RepeatLayout = "Table | Flow"
runat = "server"
SelectedIndex = integer
SelectedValue = "string"
SkinID = "string"
Style = "string"
TabIndex = integer
TextAlign = "Left | Right"
ToolTip = "string"
ValidationGroup = "string"
Visible = "True | False"
Width = size
>
<asp:ListItem
Enabled = "True | False"
Selected = "True | False"
Text = "string"
Value = "string"
/>
</asp:RadioButtonList>
For information on the individual members of this class, see RadioButtonList in the class library.
The RadioButtonList control renders a single-selection radio button group that can be dynamically generated by binding to a data source. It contains an Items collection with members that correspond to individual items on the list. To determine which item is selected, test the SelectedItem property of the list.
You can specify the rendering of the list with the RepeatLayout and RepeatDirection properties. If RepeatLayout is set to RepeatLayout.Table ( the default setting ), the list will be rendered within a table. If it is set to RepeatLayout.Flow, the list will be rendered without any tabular structure. By default, RepeatDirection is set to RepeatDirection.Vertical. Setting this property to RepeatDirection.Horizontal will render the list horizontally.
NOTE: You can also use the RadioButton control. The RadioButtonList control is easier for creating a set of radio buttons using data binding, while an individual RadioButton control gives you greater control over layout.
RadioButtonList Class RadioButton and RadioButtonlist Web Server Controls