TableRowCollection クラスとは? わかりやすく解説

TableRowCollection クラス

Table コントロール単一行を表す TableRow オブジェクトコレクションカプセル化ます。このクラス継承できません。

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

Public NotInheritable Class
 TableRowCollection
    Implements IList, ICollection, IEnumerable
Dim instance As TableRowCollection
public sealed class TableRowCollection : IList,
 ICollection, IEnumerable
public ref class TableRowCollection sealed
 : IList, ICollection, IEnumerable
public final class TableRowCollection implements
 IList, ICollection, 
    IEnumerable
public final class TableRowCollection implements
 IList, ICollection, 
    IEnumerable
解説解説
使用例使用例

Rows プロパティ使用してテーブルの行を表す TableRow オブジェクトTable コントロール追加することによって、プログラムテーブルに行を追加する方法の例を次に示します

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

 <html>
 <head>
     <script runat="server">

        Sub Page_Load(sender As Object,
 e As EventArgs)
            ' Generate rows and cells.           
            Dim numrows As Integer
 = 3
            Dim numcells As Integer
 = 2
            Dim j As Integer
            For j = 0 To numrows - 1
                Dim r As New
 TableRow()
                Dim i As Integer
                For i = 0 To numcells - 1
                    Dim c As New
 TableCell()
                    c.Text = "row " & j.ToString()
 & ", cell " & i.ToString()
                    r.Cells.Add(c)
                Next i
                Table1.Rows.Add(r)
            Next j
        End Sub
        
     </script>
 </head>
 <body>
     <h3>Table Example, constructed programmatically</h3>
     <form runat=server>
         <asp:Table id="Table1"
              runat="server"/>
     </form>
 </body>
 </html>
    
<%@ Page Language="C#" AutoEventWireup="True" %>

 <html>
 <head>
     <script runat="server">
         void Page_Load(Object sender, EventArgs e) {
             // Generate rows and cells.           
             int numrows = 3;
             int numcells = 2;
             for (int j=0; j<numrows; j++)
 {          
                 TableRow r = new TableRow();
                 for (int i=0; i<numcells;
 i++) {
                     TableCell c = new TableCell();
                     c.Text="row " + j.ToString() + ", cell "
 + i.ToString();
                     r.Cells.Add(c);
                 }
                 Table1.Rows.Add(r);
             }
         }
     </script>
 </head>
 <body>
     <h3>Table Example, constructed programmatically</h3>
     <form runat=server>
         <asp:Table id="Table1"
              runat="server"/>
     </form>
 </body>
 </html>
    
<html>
<head>
    <script language="C#" runat="server">














    </script>
</head>
<body>
    <h3><font
 face="Verdana">Table Example, constructed programmatically</font></h3>
    <form runat=server>
        <asp:Table id="Table1"
             runat="server"/>
    </form>
</body>
</html>
   
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
  System.Web.UI.WebControls.TableRowCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TableRowCollection メンバ
System.Web.UI.WebControls 名前空間
TableRow クラス
Table.Rows プロパティ
TableCell クラス
TableRow.Cells プロパティ
Table クラス
その他の技術情報
Table、TableRow、TableCell の各 Web サーバー コントロール



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

辞書ショートカット

すべての辞書の索引

「TableRowCollection クラス」の関連用語

TableRowCollection クラスのお隣キーワード
検索ランキング

   

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



TableRowCollection クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS