RadioButtonList.RepeatColumns Własność
Definicja
Ważny
Niektóre informacje dotyczą produktów przedpremierowych, które mogą zostać znacznie zmodyfikowane przed premierą. Microsoft nie udziela żadnych gwarancji, ani wyraźnych, ani domniemanych, dotyczących informacji podanych tutaj.
Pobiera lub ustawia liczbę kolumn do wyświetlenia w kontrolce 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
Wartość nieruchomości
Liczba kolumn do wyświetlenia w elemecie RadioButtonList. Wartość domyślna to 0, co oznacza, że ta właściwość nie jest ustawiona.
- Atrybuty
Wyjątki
Liczba kolumn jest ustawiona na wartość ujemną.
Przykłady
W poniższym przykładzie kodu pokazano, jak używać RepeatColumns właściwości do wyświetlania elementów kontrolki RadioButtonList w dwóch kolumnach.
<%@ 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>
Uwagi
RepeatLayout Gdy właściwość jest ustawiona na Tablewartość , możesz użyć tej właściwości, aby określić liczbę kolumn, które wyświetlają elementy w kontrolceRadioButtonList. Jeśli ta właściwość nie jest ustawiona, kontrolka RadioButtonList wyświetla wszystkie elementy na liście w jednej kolumnie.