HtmlTable.HtmlTableRowControlCollection クラスとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HtmlTable.HtmlTableRowControlCollection クラスの意味・解説 

HtmlTable.HtmlTableRowControlCollection クラス

HtmlTable コントロールの行である HtmlTableRow オブジェクトコレクション表します

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

Protected Class HtmlTableRowControlCollection
    Inherits ControlCollection
Dim instance As HtmlTableRowControlCollection
protected class HtmlTableRowControlCollection
 : ControlCollection
private ref class HtmlTableRowControlCollection
 : public ControlCollection
protected class HtmlTableRowControlCollection
 extends ControlCollection
protected class HtmlTableRowControlCollection
 extends ControlCollection
解説解説

HtmlTable.HtmlTableRowControlCollection クラスは、HtmlTable コントロールHtmlTableRow オブジェクトコレクション表しますコントロールは、Add メソッド使用してコレクション末尾、または AddAt メソッド内の指定されインデックス位置追加できますHtmlTable.HtmlTableRowControlCollection コレクション追加できるのは、型 HtmlTableRowコントロールのみです。

使用例使用例

Add メソッドオーバーライドするカスタム HtmlTable.HtmlTableRowControlCollection作成しテーブルに行を追加した場合にその行が必ずテーブルの行コレクション先頭追加されるようにする方法次のコード例示します

<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.VB.Controls"
 Assembly="Samples.AspNet.VB"
 %>
<%@ Page Language="VB" AutoEventWireup="True"
 %>
<html>
  <head>
    <title>Custom HtmlTable - CustomHtmlTableRowControlCollection Example</title>
  </head>
  <body>
    <form id="Form1" 
          method="post" 
          runat="server">
      <h3>Custom HtmlTable - CustomHtmlTableRowControlCollection Example</h3>
      
      <aspSample:CustomHtmlTableRowControlCollection 
        id="HtmlTable1" 
        name="HtmlTable1" 
        runat="server" 
        border="1"
        cellSpacing="0" 
        cellPadding="5">
        <TR>
          <TD>1,1</TD>
          <TD>1,2</TD>
          <TD>1,3</TD>
        </TR>
        <TR>
          <TD>2,1</TD>
          <TD>2,2</TD>
          <TD>2,3</TD>
        </TR>
        <TR>
          <TD>3,1</TD>
          <TD>3,2</TD>
          <TD>3,3</TD>
        </TR>
      </aspSample:CustomHtmlTableRowControlCollection>

    </form>

  </body>
</html>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS.Controls"
 Assembly="Samples.AspNet.CS" %>
<%@ Page Language="C#" AutoEventWireup="True" %>
<html>
  <head>
    <title>Custom HtmlTable - CustomHtmlTableRowControlCollection Example</title>
  </head>
  <body>
    <form id="Form1" 
          method="post" 
          runat="server">
      <h3>Custom HtmlTable - CustomHtmlTableRowControlCollection Example</h3>
      
      <aspSample:CustomHtmlTableRowControlCollection 
        id="HtmlTable1" 
        name="HtmlTable1" 
        runat="server" 
        border="1"
        cellSpacing="0" 
        cellPadding="5">
        <TR>
          <TD>1,1</TD>
          <TD>1,2</TD>
          <TD>1,3</TD>
        </TR>
        <TR>
          <TD>2,1</TD>
          <TD>2,2</TD>
          <TD>2,3</TD>
        </TR>
        <TR>
          <TD>3,1</TD>
          <TD>3,2</TD>
          <TD>3,3</TD>
        </TR>
      </aspSample:CustomHtmlTableRowControlCollection>

    </form>

  </body>
</html> 
Imports System.Web
Imports System.Web.UI
Imports System.Security.Permissions

Namespace Samples.AspNet.VB.Controls
    <AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal)>
 _
    Public NotInheritable Class
 CustomHtmlTableRowControlCollection
        Inherits System.Web.UI.HtmlControls.HtmlTable

        Protected Overrides Function
 CreateControlCollection() As System.Web.UI.ControlCollection

            Return New MyHtmlTableRowControlCollection(Me)

        End Function

        Protected Class MyHtmlTableRowControlCollection
            Inherits ControlCollection

            Friend Sub New(ByVal
 owner As Control)

                MyBase.New(owner)

            End Sub

            Public Overrides Sub
 Add(ByVal child As Control)

                ' Always add new rows at the top of the table.
                MyBase.AddAt(0, child)

            End Sub

        End Class

    End Class

End Namespace
using System.Web;
using System.Web.UI;
using System.Security.Permissions;

namespace Samples.AspNet.CS.Controls
{
    [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)]
    public class CustomHtmlTableRowControlCollection
 : System.Web.UI.HtmlControls.HtmlTable
    {

       protected override ControlCollection CreateControlCollection()
       {

         return new MyHtmlTableRowControlCollection(this);

       }

       protected class MyHtmlTableRowControlCollection
 : ControlCollection
       {

         internal MyHtmlTableRowControlCollection(Control owner) : base(owner)
 { }

         public override void Add(Control child)
         {

           // Always add new rows at the top of the table.
           base.AddAt(0, child);
         }

       }

    }

}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.Web.UI.ControlCollection
    System.Web.UI.HtmlControls.HtmlTable.HtmlTableRowControlCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HtmlTable.HtmlTableRowControlCollection メンバ
System.Web.UI.HtmlControls 名前空間
CreateControlCollection
ControlCollection



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

辞書ショートカット

すべての辞書の索引

「HtmlTable.HtmlTableRowControlCollection クラス」の関連用語

HtmlTable.HtmlTableRowControlCollection クラスのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS