CheckBoxList.RepeatLayout プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CheckBoxList.RepeatLayout プロパティの意味・解説 

CheckBoxList.RepeatLayout プロパティ

チェック ボックスレイアウト取得または設定します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Overridable Property
 RepeatLayout As RepeatLayout
Dim instance As CheckBoxList
Dim value As RepeatLayout

value = instance.RepeatLayout

instance.RepeatLayout = value
public virtual RepeatLayout RepeatLayout { get;
 set; }
public:
virtual property RepeatLayout RepeatLayout {
    RepeatLayout get ();
    void set (RepeatLayout value);
}
/** @property */
public RepeatLayout get_RepeatLayout ()

/** @property */
public void set_RepeatLayout (RepeatLayout
 value)
public function get RepeatLayout
 () : RepeatLayout

public function set RepeatLayout
 (value : RepeatLayout)

プロパティ
RepeatLayout 値の 1 つ既定値Table です。

例外例外
例外種類条件

ArgumentException

指定したレイアウトが、RepeatLayout 値ではありません。

解説解説

このプロパティ使用して、CheckBoxList コントロールの項目をテーブル内に表示するかどうか指定します。このプロパティRepeatLayout.Table設定すると、リストの項目はテーブル内に表示されます。このプロパティRepeatLayout.Flow設定すると、リストの項目はテーブル構造なしで表示されます。

使用例使用例

RepeatLayout プロパティ使用してテーブル構造なしで CheckBoxList コントロール表示する方法コード例次に示します

メモメモ

次のコード サンプルはシングルファイル コード モデル使用しており、分離コード ファイル直接コピーされ場合正常に動作しない可能性あります。各コード サンプルは、拡張子.aspx の空のテキスト ファイルコピーする必要がありますWeb フォームコード モデル詳細については、「ASP.NET Web ページコード モデル」を参照してください

<%@ Page Language="VB" AutoEventWireup="True"
 %>
<html>
<head>

<script language="VB" runat="server">

   Sub Check_Clicked(sender As Object,
 e As EventArgs)
      Dim i As Integer
      Message.Text = "Selected Item(s):<br><br>"
      For i=0 To checkboxlist1.Items.Count
 - 1
         If checkboxlist1.Items(i).Selected Then
            Message.Text += checkboxlist1.Items(i).Text + "<br>"
         End If
      Next
   End Sub

</script>
 
</head>
<body>
   
   <form action="checkboxlist.aspx" method="post"
 runat="server">
 
      <h3>CheckBoxList Example</h3>

      <asp:CheckBoxList id="checkboxlist1" 
           AutoPostBack="True"
           CellPadding="5"
           CellSpacing="5"
           RepeatColumns="2"
           RepeatDirection="Vertical"
           RepeatLayout="Flow"
           TextAlign="Right"
           OnSelectedIndexChanged="Check_Clicked"
           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:CheckBoxList>
 
      <br><br>

      <asp:label id="Message" runat="server"/>
             
   </form>
          
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="True" %>
<html>
<head>

<script language="C#" runat="server">

   void Check_Clicked(Object sender, EventArgs e) 
   {
      Message.Text = "Selected Item(s):<br><br>";
      for (int i=0; i<checkboxlist1.Items.Count;
 i++)
      {
         if (checkboxlist1.Items[i].Selected)
            Message.Text += checkboxlist1.Items[i].Text + "<br>";
      }
   }

</script>
 
</head>
<body>
   
   <form action="checkboxlist.aspx" method="post" runat="server">
 
      <h3>CheckBoxList Example</h3>

      <asp:CheckBoxList id="checkboxlist1" 
           AutoPostBack="True"
           CellPadding="5"
           CellSpacing="5"
           RepeatColumns="2"
           RepeatDirection="Vertical"
           RepeatLayout="Flow"
           TextAlign="Right"
           OnSelectedIndexChanged="Check_Clicked"
           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:CheckBoxList>
 
      <br><br>

      <asp:label id="Message" runat="server"/>
             
   </form>
          
</body>
</html>
<%@ Page Language="JScript" AutoEventWireup="True" %>
<html>
<head>

<script language="JScript" runat="server">

   function Check_Clicked(sender : Object, e : EventArgs) 
   {
      Message.Text = "Selected Item(s):<br><br>";
      for (var i : int =
 0; i<checkboxlist1.Items.Count; i++)
      {
         if (checkboxlist1.Items[i].Selected)
            Message.Text += checkboxlist1.Items[i].Text + "<br>";
      }
   }

</script>
 
</head>
<body>
   
   <form action="checkboxlist.aspx" method="post" runat="server">
 
      <h3>CheckBoxList Example</h3>

      <asp:CheckBoxList id="checkboxlist1" 
           AutoPostBack="True"
           CellPadding="5"
           CellSpacing="5"
           RepeatColumns="2"
           RepeatDirection="Vertical"
           RepeatLayout="Flow"
           TextAlign="Right"
           OnSelectedIndexChanged="Check_Clicked"
           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:CheckBoxList>
 
      <br><br>

      <asp:label id="Message" runat="server"/>
             
   </form>
          
</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True"
 %>

<html>

<head>

   <script runat="server">

      Sub Check_Clicked(sender as Object,
 e As EventArgs) 

         Message.Text = "Selected Item(s):<br><br>"

         ' Iterate through the Items collection of the CheckBoxList
         ' control and display the selected items.
         Dim i As Integer

         For i=0 To checkboxlist1.Items.Count
 - 1

            If checkboxlist1.Items(i).Selected Then

               Message.Text &= checkboxlist1.Items(i).Text & "<br>"

            End If

         Next

      End Sub

      Sub Index_Change(sender as Object,
 e As EventArgs) 

         ' Set the layout (table or flow) of the CheckBoxList control.
         checkboxlist1.RepeatLayout = CType(List.SelectedIndex, RepeatLayout)

      End Sub

   </script>
 
</head>

<body>
   
   <form runat="server">
 
      <h3> CheckBoxList RepeatLayout Example </h3>

      Select items from the CheckBoxList.

      <br><br>

      <asp:CheckBoxList id="checkboxlist1" 
           AutoPostBack="True"
           CellPadding="5"
           CellSpacing="5"
           RepeatColumns="2"
           RepeatDirection="Vertical"
           RepeatLayout="Table"
           TextAlign="Right"
           OnSelectedIndexChanged="Check_Clicked"
           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:CheckBoxList>
 
      <br><br>

      <asp:label id="Message" runat="server"/>

      <hr>

      Select whether to display the CheckBoxList
 control in 
      table or flow layout.

      <table cellpadding="5">

         <tr>

            <td>

               RepeatLayout:

            </td>

         </tr>

         <tr>

            <td>

               <asp:DropDownList id="List"
                    AutoPostBack="True"
                    OnSelectedIndexChanged="Index_Change"
                    runat="server">

                  <asp:ListItem Selected="True">Table</asp:ListItem>
                  <asp:ListItem>Flow</asp:ListItem>

               </asp:DropDownList>

            </td>

         </tr>

      </table>
             
   </form>
          
</body>

</html>

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

<html>

<head>

   <script runat="server">

      void Check_Clicked(Object sender, EventArgs e) 
      {

         Message.Text = "Selected Item(s):<br><br>";

         // Iterate through the Items collection of the CheckBoxList
         // control and display the selected items.
         for (int i=0; i<checkboxlist1.Items.Count;
 i++)
         {

            if (checkboxlist1.Items[i].Selected)
            {

               Message.Text += checkboxlist1.Items[i].Text + "<br>";

            }

         }

      }

      void Index_Change(Object sender, EventArgs e) 
      {

         // Set the layout (table or flow) of the CheckBoxList control.
         checkboxlist1.RepeatLayout = (RepeatLayout)List.SelectedIndex;

      }

   </script>
 
</head>

<body>
   
   <form runat="server">
 
      <h3> CheckBoxList RepeatLayout Example </h3>

      Select items from the CheckBoxList.

      <br><br>

      <asp:CheckBoxList id="checkboxlist1" 
           AutoPostBack="True"
           CellPadding="5"
           CellSpacing="5"
           RepeatColumns="2"
           RepeatDirection="Vertical"
           RepeatLayout="Table"
           TextAlign="Right"
           OnSelectedIndexChanged="Check_Clicked"
           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:CheckBoxList>
 
      <br><br>

      <asp:label id="Message" runat="server"/>

      <hr>

      Select whether to display the CheckBoxList control in 
      table or flow layout.

      <table cellpadding="5">

         <tr>

            <td>

               RepeatLayout:

            </td>

         </tr>

         <tr>

            <td>

               <asp:DropDownList id="List"
                    AutoPostBack="True"
                    OnSelectedIndexChanged="Index_Change"
                    runat="server">

                  <asp:ListItem Selected="True">Table</asp:ListItem>
                  <asp:ListItem>Flow</asp:ListItem>

               </asp:DropDownList>

            </td>

         </tr>

      </table>
             
   </form>
          
</body>

</html>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CheckBoxList クラス
CheckBoxList メンバ
System.Web.UI.WebControls 名前空間
CheckBoxList.RepeatColumns プロパティ
CheckBoxList.RepeatDirection プロパティ
その他の技術情報
CheckBox Web サーバー コントロールおよび CheckBoxList Web サーバー コントロール


このページでは「.NET Framework クラス ライブラリ リファレンス」からCheckBoxList.RepeatLayout プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からCheckBoxList.RepeatLayout プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からCheckBoxList.RepeatLayout プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CheckBoxList.RepeatLayout プロパティ」の関連用語

CheckBoxList.RepeatLayout プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CheckBoxList.RepeatLayout プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS