RadioButtonList.RepeatDirection プロパティ

定義

グループのオプション ボタンを表示する方向を取得または設定します。

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

プロパティ値

RepeatDirection 値のいずれか 1 つ。 既定値は、Vertical です。

属性

例外

リストの表示方向は、RepeatDirection 値ではありません。

次のコード例では、 プロパティを RepeatDirection 使用して、コントロールの RadioButtonList 項目を上から下、左から右に入力した列に表示する方法を示します。

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

<asp:RadioButtonList id="RadioButtonList1"
      RepeatLayout="Table"
      RepeatColumns = "2" 
      RepeatDirection="Vertical" 
      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.RepeatDirection Example</title>
</head>
<body>

<asp:RadioButtonList id="RadioButtonList1"
      RepeatLayout="Table"
      RepeatColumns = "2" 
      RepeatDirection="Vertical" 
      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>

注釈

コントロールの表示方向を指定するには、このプロパティを使用します RadioButtonList

注意

表示される列の数は、常に プロパティによって RepeatColumns 決まります。

このプロパティが にRepeatDirection.Vertical設定され、 プロパティが にTable設定されている場合RepeatLayout、最初の列は上から下、次の列など、すべての項目がレンダリングされるまで塗りつぶされます。 たとえば、 が 3 に設定されている場合 RepeatColumns 、コントロールの RadioButtonList 項目は 3 つの列に表示されます。 9 項目のリストは次のように表示されます。

1 4 7
2 5 8
3 6 9

このプロパティが にRepeatDirection.Horizontal設定され、 プロパティが にTable設定されている場合RepeatLayout、リスト内の項目は、すべての項目がレンダリングされるまで、左から右、上から下に読み込まれた行で表示されます。 たとえば、 が 3 に設定されている場合 RepeatColumns 、コントロールの RadioButtonList 項目は 3 つの項目の行に表示されます。 9 項目のリストは次のように表示されます。

1 2 3
4 5 6
7 8 9

適用対象

こちらもご覧ください