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

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

CheckBoxList.RepeatColumns プロパティ

CheckBoxList コントロール表示する列数を取得または設定します

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

Public Overridable Property
 RepeatColumns As Integer
Dim instance As CheckBoxList
Dim value As Integer

value = instance.RepeatColumns

instance.RepeatColumns = value
public virtual int RepeatColumns { get;
 set; }
public:
virtual property int RepeatColumns {
    int get ();
    void set (int value);
}
/** @property */
public int get_RepeatColumns ()

/** @property */
public void set_RepeatColumns (int
 value)
public function get RepeatColumns
 () : int

public function set RepeatColumns
 (value : int)

プロパティ
CheckBoxList コントロール表示する列数。既定値0 です。このプロパティ設定されていないことを示します

例外例外
例外種類条件

ArgumentOutOfRangeException

列数が負の値に設定されています。

解説解説
使用例使用例

RepeatColumns プロパティ使用してCheckBoxList コントロールに 2 列を表示する方法コード例次に示します

メモメモ

次のコード サンプルはシングルファイル コード モデル使用しており、分離コード ファイル直接コピーされ場合正常に動作しない可能性あります。各コード サンプルは、拡張子.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 number columns in the CheckBoxList control.
         checkboxlist1.RepeatColumns = List.SelectedIndex

      End Sub

   </script>
 
</head>

<body>
   
   <form runat="server">
 
      <h3> CheckBoxList RepeatColumns 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 the number of columns to
 display.

      <table cellpadding="5">

         <tr>

            <td>

               RepeatColumns:

            </td>

         </tr>

         <tr>

            <td>

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

                  <asp:ListItem>0</asp:ListItem>
                  <asp:ListItem>1</asp:ListItem>
                  <asp:ListItem Selected="True">2</asp:ListItem>
                  <asp:ListItem>3</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 number columns in the CheckBoxList control.
         checkboxlist1.RepeatColumns = List.SelectedIndex;

      }

   </script>
 
</head>

<body>
   
   <form runat="server">
 
      <h3> CheckBoxList RepeatColumns 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 the number of columns to display.

      <table cellpadding="5">

         <tr>

            <td>

               RepeatColumns:

            </td>

         </tr>

         <tr>

            <td>

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

                  <asp:ListItem>0</asp:ListItem>
                  <asp:ListItem>1</asp:ListItem>
                  <asp:ListItem Selected="True">2</asp:ListItem>
                  <asp:ListItem>3</asp:ListItem>

               </asp:DropDownList>

            </td>

         </tr>

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

</html>

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


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

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

辞書ショートカット

すべての辞書の索引

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

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

   

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



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

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

©2025 GRAS Group, Inc.RSS