System.Web
1.0.5000.0
2.0.0.0
Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.
System.Web.UI.WebControls.ListControl
System.Web.UI.INamingContainer
System.Web.UI.IPostBackDataHandler
System.Web.UI.WebControls.IRepeatInfoUser
System.Web.UI.SupportsEventValidation
System.Web.UI.ValidationProperty("SelectedItem")
In this topic:
-
Introduction
-
Specifying List Layout
-
Accessibility
-
Declarative Syntax
Introduction
The control provides page developers with a single-selection radio button group that can be dynamically generated through data binding. It contains an collection with members that correspond to individual items on the list. To determine which item is selected, test the property of the list.
Specifying List Layout
You can specify how the list is rendered by setting the and properties. For information about layout options, see the enumeration.
By default, is set to RepeatDirection.Vertical. Setting this property to RepeatDirection.Horizontal causes the control to render the list horizontally. Some settings do not allow horizontal layout. For more information, see the enumeration.
This control can be used to display user input, which might include malicious client script. Check any information that is sent from a client for executable script, SQL statements, or other code before displaying it in your application. You can use validation controls to verify user input before displaying the input text in a control. ASP.NET provides an input request validation feature to block script and HTML in user input. For more information, see Securing Standard Controls, How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings, and Introduction to Validating User Input in ASP.NET Web Pages.
Accessibility
For information about how to configure this control so that it generates markup that conforms to accessibility standards, see Accessibility in Visual Studio 2010 and ASP.NET 4 and ASP.NET Controls and Accessibility.
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|OrderedList|UnorderedList"
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>
Represents a list control that encapsulates a group of radio button controls.
Constructor
Use this constructor to create and initialize a new instance of the class.
Initializes a new instance of the class.
1.0.5000.0
2.0.0.0
Property
System.Int32
To be added: an object of type 'int'
This property applies only when the property is set to RepeatLayout.Table.
Use this property to control the spacing between the contents of a cell and the cell's border.
The padding amount specified is added to all four sides of a cell. It uses the height of the tallest cell in the table and the width of the widest cell in the table. The resulting cell size is applied uniformly to all cells in the table. Individual cell sizes cannot be specified.
Gets or sets the distance (in pixels) between the border and the contents of the table cell.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(-1)
Property
System.Int32
To be added: an object of type 'int'
This property applies only when the property is set to RepeatLayout.Table.
Use this property to control the spacing between individual cells in the table. This property is applied both vertically and horizontally.
Gets or sets the distance (in pixels) between adjacent table cells.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(-1)
Method
System.Web.UI.WebControls.Style
The method is used primarily by control developers in custom control that derive from the class.
Creates a style object that is used internally by the control to implement all style-related properties.
A that contains the style properties of the control.
1.0.5000.0
2.0.0.0
Method
2.0.0.0
System.Web.UI.Control
The method is used primarily by control developers in custom controls that derive from the class.
The method overrides the method of the base class. You should not override this version of the method.
Searches the current naming container for a server control with the specified ID and path offset. The method always returns the object.
The current .
The identifier for the control to find.
The number of controls up the page control hierarchy needed to reach a naming container.
Method
2.0.0.0
System.Web.UI.WebControls.Style
The method is used primarily by control developers in custom controls that derive from the class.
The style attribute for the control applies to all list items that are contained by the control. Use the property of the control to examine or set the style attribute for the control and its list items.
Retrieves the style of the specified item type at the specified index in the list control.
null, indicating that style attributes are not set on individual list items in a control.
One of the enumeration values.
An ordinal index that specifies the location of the item in the list control.
Property
2.0.0.0
System.Boolean
To be added.
The property is used primarily by control developers in custom controls that derive from the class. Footers are not supported when the property is set to or .
Gets a value indicating whether the control contains a footer section.
Property
2.0.0.0
System.Boolean
To be added.
The property is used primarily by control developers in custom controls that derive from the class. Headers are not supported when the property is set to or .
Gets a value indicating whether the control contains a heading section.
Property
2.0.0.0
System.Boolean
To be added.
The property is used primarily by control developers in custom controls that derive from the class. Separators are not supported when the property is set to or .
Gets a value indicating whether the control contains separators between items in the list.
Method
2.0.0.0
System.Boolean
The method is used primarily by control developers in custom controls that derive from the class.
The method indicates whether the state of the control has changed. In other words, it determines whether the selected list item in the control is the same as the last posted value. A user changing the selected item in the control changes the value for the control. If the same list item is selected in the control, or if the control is disabled, returns false.
When the method returns true for a control, the ASP.NET page framework invokes the method for the control.
Processes the posted data for the control.
true if the state of the is different from the last posting; otherwise, false.
The key identifier for the control, used to index the .
A that contains value information indexed by control identifiers.
Method
2.0.0.0
System.Void
The method is used primarily by control developers in custom controls that derive from the class.
The ASP.NET page framework calls the method on a control when the method indicates that the state of the list items have changed in the control. The method calls the method to raise the event. Control developers can override the method to perform custom processing when the user changes the selected item in the control.
The RaisePostBackEvent method can optionally perform validation before raising the event for the control. To validate a group of controls on the page when a list item within the control is selected, set the and properties to true, and then specify the group of controls to be validated in the property.
Notifies the ASP.NET application that the state of the control has changed.
Method
System.Void
This method is used primarily by control developers in custom controls that derive from the class.
The method implementation for a control initializes a object for the list, and calls the method, which in turn uses the method to render individual radio button list items.
Displays the control on the client.
A that contains the output stream for rendering on the client.
1.0.5000.0
2.0.0.0
Method
2.0.0.0
System.Void
This method is used primarily by control developers in custom controls that derive from the class.
The method implementation for a control initializes a object for the list, and calls the method, which in turn uses the method to render individual radio-button list items.
The method for a control ignores the and parameters. The parameter value is used to select the radio button list item in the collection, and the selected list item is rendered to the output stream.
Renders a list item in the control.
One of the enumeration values.
An ordinal index that specifies the location of the item in the list control.
A that represents the information used to render the item in the list.
A that represents the output stream to render HTML content on the client.
Property
System.Int32
To be added: an object of type 'int'
When the property is set to , you can use this property to specify the number of columns that display items in the control. If this property is not set, the control displays all items in the list in a single column.
Gets or sets the number of columns to display in the control.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(0)
Property
System.Web.UI.WebControls.RepeatDirection
To be added: an object of type 'RepeatDirection'
Use this property to specify the display direction of the control.
The number of columns that are displayed is always determined by the property.
If this property is set to RepeatDirection.Vertical and if the property is set to , the first column is filled from top to bottom, then the next column, and so on until all items are rendered. For example, if is set to 3, the items of the control are displayed in three columns. A nine-item list would appear as follows.
-
1
4
7
-
2
5
8
-
3
6
9
If this property is set to RepeatDirection.Horizontal and if the property is set to , the items in the list are displayed in rows loaded left to right, then top to bottom, until all items are rendered. For example, if is set to 3, the items of the control are displayed in rows of three items. A nine-item list would appear as follows.
-
1
2
3
-
4
5
6
-
7
8
9
Gets or sets the direction in which the radio buttons within the group are displayed.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(System.Web.UI.WebControls.RepeatDirection.Vertical)
Property
2.0.0.0
System.Int32
To be added.
The property is used primarily by control developers in custom controls that derive from the class.
If there are no items set in the control, the property is zero. If there are items set in the control, the property is the same as the property on the collection.
Gets the number of list items in the control.
Property
System.Web.UI.WebControls.RepeatLayout
To be added: an object of type 'RepeatLayout'
For information about the available options, see the enumeration.
Two options are new as of ASP.NET 4: and .
Some settings do not allow horizontal layout. For more information, see the enumeration.
Gets or sets a value that specifies whether the list will be rendered by using a table element, a ul element, an ol element, or a span element.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(System.Web.UI.WebControls.RepeatLayout.Table)
Method
1.0.5000.0
2.0.0.0
System.Boolean
Typically, you should use the method to process posted data for a control.
The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface.
Processes posted data for the control.
true if the server control's state changed as a result of the postback; otherwise, false.
The key identifier for the control, used to index the .
A that contains value information indexed by control identifiers.
Method
1.0.5000.0
2.0.0.0
System.Void
Typically, you should use the method to raise an event when the posted data for a control changes.
The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface.
Raised when posted data for a control has changed.
Method
1.0.5000.0
2.0.0.0
System.Web.UI.WebControls.Style
Typically, you should use the method to retrieve the style of an item in a control.
The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface.
Retrieves the style of the specified item type at the specified index in the list control.
A that represents the style of the specified item type at the specified index in the list control.
One of the enumeration values.
An ordinal index that specifies the location of the item in the list.
Property
1.0.5000.0
2.0.0.0
System.Boolean
To be added.
This property is an explicit interface member implementation. It can be used only when the instance is cast to the interface.
Gets a value that indicates whether the list control contains a footer section.
Property
1.0.5000.0
2.0.0.0
System.Boolean
To be added.
This property is an explicit interface member implementation. It can be used only when the instance is cast to the interface.
Gets a value that indicates whether the list control contains a heading section.
Property
1.0.5000.0
2.0.0.0
System.Boolean
To be added.
This property is an explicit interface member implementation. It can be used only when the instance is cast to the interface.
Gets a value that indicates whether the list control contains a separator between items in the list.
Method
1.0.5000.0
2.0.0.0
System.Void
Typically, you should use the method to render items in a control.
The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface.
Renders an item in the list with the specified information.
One of the enumeration values.
An ordinal index that specifies the location of the item in the list.
A that represents the information used to render the item in the list.
A that represents the output stream to render HTML content on the client.
Property
1.0.5000.0
2.0.0.0
System.Int32
To be added.
This property is an explicit interface member implementation. It can be used only when the instance is cast to the interface.
Gets the number of items in the list control.
Property
System.Web.UI.WebControls.TextAlign
To be added: an object of type 'TextAlign'
Use this property to specify whether the text associated with the radio buttons appears on the left or right. If this property is set to TextAlign.Right, the text is displayed to the right of the radio button. If this property is set to TextAlign.Left, the text is displayed to the left of the radio button.
Gets or sets the text alignment for the radio buttons within the group.
1.0.5000.0
2.0.0.0
System.ComponentModel.DefaultValue(System.Web.UI.WebControls.TextAlign.Right)