This documentation is archived and is not being maintained.

RadioButtonList.RepeatColumns Property

Gets or sets the number of columns to display in the RadioButtonList control.

[Visual Basic]
Public Overridable Property RepeatColumns As Integer
[C#]
public virtual int RepeatColumns {get; set;}
[C++]
public: __property virtual int get_RepeatColumns();
public: __property virtual void set_RepeatColumns(int);
[JScript]
public function get RepeatColumns() : int;
public function set RepeatColumns(int);

Property Value

The number of columns to display in the RadioButtonList control. The default is 0, which indicates that this property is not set.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException The number of columns is set to a negative value.

Remarks

Use this property to specify the number of columns that display items in the RadioButtonList control. If this property is not set, the RadioButtonList control will display all items in the list in a single column.

Example

[Visual Basic, C#, JScript] The following example demonstrates how to use the RepeatColumns property to display the items of a RadioButtonList in two columns.

[Visual Basic] 
<%@ Page Language="VB" AutoEventWireup="True" %>

<asp:RadioButtonList id=RadioButtonList1
      RepeatColumns = "2" 
      runat="server">
 
    <asp:ListItem>Item 1</asp:ListItem>
    <asp:ListItem>Item 2</asp:ListItem>
    <asp:ListItem>Item 3</asp:ListItem>
    <asp:ListItem>Item 4</asp:ListItem>
    <asp:ListItem>Item 5</asp:ListItem>
    <asp:ListItem>Item 6</asp:ListItem>

 </asp:RadioButtonList>


[C#] 
<%@ Page Language="C#" AutoEventWireup="True" %>

<asp:RadioButtonList id=RadioButtonList1
      RepeatColumns = "2" 
      runat="server">
 
    <asp:ListItem>Item 1</asp:ListItem>
    <asp:ListItem>Item 2</asp:ListItem>
    <asp:ListItem>Item 3</asp:ListItem>
    <asp:ListItem>Item 4</asp:ListItem>
    <asp:ListItem>Item 5</asp:ListItem>
    <asp:ListItem>Item 6</asp:ListItem>

 </asp:RadioButtonList>


[JScript] 
<%@ Page Language="JScript" AutoEventWireup="True" %>

<asp:RadioButtonList id=RadioButtonList1
      RepeatColumns = "2" 
      runat="server">
 
    <asp:ListItem>Item 1</asp:ListItem>
    <asp:ListItem>Item 2</asp:ListItem>
    <asp:ListItem>Item 3</asp:ListItem>
    <asp:ListItem>Item 4</asp:ListItem>
    <asp:ListItem>Item 5</asp:ListItem>
    <asp:ListItem>Item 6</asp:ListItem>

 </asp:RadioButtonList>

[C++] No example is available for C++. To view a Visual Basic, C#, or JScript example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

RadioButtonList Class | RadioButtonList Members | System.Web.UI.WebControls Namespace | RepeatLayout | RepeatDirection

Show: