HtmlTable.HtmlTableRowControlCollection 클래스

정의

컨트롤의 HtmlTableRow 행인 개체 컬렉션을 HtmlTable 나타냅니다.

protected: ref class HtmlTable::HtmlTableRowControlCollection : System::Web::UI::ControlCollection
protected class HtmlTable.HtmlTableRowControlCollection : System.Web.UI.ControlCollection
Protected Class HtmlTable.HtmlTableRowControlCollection
Inherits ControlCollection
상속
HtmlTable.HtmlTableRowControlCollection

예제

다음 코드 예제에서는 테이블에 행을 추가할 때 항상 테이블의 행 컬렉션 시작 부분에 추가되도록 메서드를 재정 HtmlTable.HtmlTableRowControlCollection 의하는 사용자 지정 Add 을 만드는 방법을 보여 줍니다.

<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS.Controls" Assembly="Samples.AspNet.CS" %>
<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <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.VB.Controls" Assembly="Samples.AspNet.VB" %>
<%@ Page Language="VB" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <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>
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);
         }
       }
    }
}
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

설명

이 클래스는 HtmlTable.HtmlTableRowControlCollection 컨트롤에 대한 HtmlTableRow 개체 컬렉션을 HtmlTable 나타냅니다. 컨트롤은 메서드를 사용하여 컬렉션 Add 의 끝에 추가하거나 메서드를 사용하여 컬렉션 AddAt 의 지정된 인덱스 위치에 추가할 수 있습니다. 형식 HtmlTableRow 의 컨트롤만 컬렉션에 HtmlTable.HtmlTableRowControlCollection 추가할 수 있습니다.

속성

Name Description
Count

지정된 ASP.NET 서버 컨트롤에 ControlCollection 대한 개체의 서버 컨트롤 수를 가져옵니다.

(다음에서 상속됨 ControlCollection)
IsReadOnly

개체가 읽기 전용인지 여부를 ControlCollection 나타내는 값을 가져옵니다.

(다음에서 상속됨 ControlCollection)
IsSynchronized

개체가 동기화되는지 여부를 ControlCollection 나타내는 값을 가져옵니다.

(다음에서 상속됨 ControlCollection)
Item[Int32]

개체의 지정된 인덱스 위치에 있는 서버 컨트롤에 대한 참조를 ControlCollection 가져옵니다.

(다음에서 상속됨 ControlCollection)
Owner

개체가 속한 ASP.NET 서버 컨트롤을 ControlCollection 가져옵니다.

(다음에서 상속됨 ControlCollection)
SyncRoot

컨트롤 컬렉션에 대한 액세스를 동기화하는 데 사용할 수 있는 개체를 가져옵니다.

(다음에서 상속됨 ControlCollection)

메서드

Name Description
Add(Control)

컬렉션에 지정된 Control 개체를 추가합니다.

AddAt(Int32, Control)

컬렉션에 지정된 Control 개체를 추가합니다. 새 컨트롤이 지정된 인덱스 위치의 배열에 추가됩니다.

Clear()

현재 서버 컨트롤의 ControlCollection 개체에서 모든 컨트롤을 제거합니다.

(다음에서 상속됨 ControlCollection)
Contains(Control)

지정된 서버 컨트롤이 부모 서버 컨트롤의 ControlCollection 개체에 있는지 여부를 확인합니다.

(다음에서 상속됨 ControlCollection)
CopyTo(Array, Int32)

개체에 저장된 ControlCollection 자식 컨트롤을 개체의 Array 지정된 인덱스 위치에서 시작하여 개체에 Array복사합니다.

(다음에서 상속됨 ControlCollection)
Equals(Object)

지정된 개체가 현재 개체와 같은지 여부를 확인합니다.

(다음에서 상속됨 Object)
GetEnumerator()

개체를 반복 ControlCollection 할 수 있는 열거자를 검색합니다.

(다음에서 상속됨 ControlCollection)
GetHashCode()

기본 해시 함수로 사용됩니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type 가져옵니다.

(다음에서 상속됨 Object)
IndexOf(Control)

컬렉션에서 지정된 Control 개체의 인덱스를 검색합니다.

(다음에서 상속됨 ControlCollection)
MemberwiseClone()

현재 Object단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
Remove(Control)

부모 서버 컨트롤의 개체에서 지정된 서버 컨트롤 ControlCollection 을 제거합니다.

(다음에서 상속됨 ControlCollection)
RemoveAt(Int32)

개체에서 지정된 인덱스 위치에 있는 자식 컨트롤을 ControlCollection 제거합니다.

(다음에서 상속됨 ControlCollection)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

확장명 메서드

Name Description
AsParallel(IEnumerable)

쿼리의 병렬 처리를 사용하도록 설정합니다.

AsQueryable(IEnumerable)

IEnumerable IQueryable변환합니다.

Cast<TResult>(IEnumerable)

IEnumerable 요소를 지정된 형식으로 캐스팅합니다.

OfType<TResult>(IEnumerable)

지정된 형식에 따라 IEnumerable 요소를 필터링합니다.

적용 대상

추가 정보