RadioButtonList.RepeatColumns Свойство

Определение

Получает или задает число столбцов для отображения в элементе управления RadioButtonList.

public:
 virtual property int RepeatColumns { int get(); void set(int value); };
[System.ComponentModel.Bindable(true)]
public virtual int RepeatColumns { get; set; }
public virtual int RepeatColumns { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.RepeatColumns : int with get, set
member this.RepeatColumns : int with get, set
Public Overridable Property RepeatColumns As Integer

Значение свойства

Число столбцов для отображения в элементе RadioButtonList. По умолчанию используется значение 0, указывающее, что это свойство не задано.

Атрибуты

Исключения

Число столбцов равно отрицательной величине.

Примеры

В следующем примере кода показано, как использовать RepeatColumns свойство для отображения элементов RadioButtonList элемента управления в двух столбцах.

<%@ Page Language="C#" AutoEventWireup="True" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>RadioButtonList.RepeatColumns Example</title>
</head>
<body>

<asp:RadioButtonList id="RadioButtonList1"
      RepeatLayout="Table"
      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>
</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>RadioButtonList.RepeatColumns Example</title>
</head>
<body>

<asp:RadioButtonList id="RadioButtonList1"
      RepeatLayout="Table"
      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>
</body>
</html>

Комментарии

Если свойству RepeatLayout присвоено значение Table, это свойство можно использовать для указания количества столбцов, в которых отображаются элементы в элементе RadioButtonList управления . Если это свойство не задано, RadioButtonList элемент управления отображает все элементы в списке в одном столбце.

Применяется к

См. также раздел