RadioButtonList.RepeatColumns Właściwość
W tym artykule
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
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
Liczba kolumn do wyświetlenia w elemecie RadioButtonList. Wartość domyślna to 0, co oznacza, że ta właściwość nie jest ustawiona.
- Atrybuty
Liczba kolumn jest ustawiona na wartość ujemną.
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>
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.
Produkt | Wersje |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Opinia o produkcie .NET
.NET to projekt typu open source. Wybierz link, aby przekazać opinię: