TableRow.CellControlCollection 類別

定義

表示 TableCell 物件的集合,這些物件是 TableRow 控制項的儲存格。

protected: ref class TableRow::CellControlCollection : System::Web::UI::ControlCollection
protected class TableRow.CellControlCollection : System.Web.UI.ControlCollection
Protected Class TableRow.CellControlCollection
Inherits ControlCollection
繼承
TableRow.CellControlCollection

範例

下列程式碼範例示範如何建立資料表、以程式設計方式將元素加入資料表,然後在網頁上顯示資料表。 請注意控制項的 TableRow 屬性如何 Cells 代表 TableRow.CellControlCollection 集合,以及 Add 如何使用 方法將儲存格加入資料列。

此程式碼範例是提供給 類別之較大範例的 TableRow 一部分。

// Create more rows for the table.
for (int rowNum = 2; rowNum < 10; rowNum++)
{
    TableRow tempRow = new TableRow();
    for (int cellNum = 0; cellNum < 3; cellNum++)
    {
        TableCell tempCell = new TableCell();
        tempCell.Text = 
            String.Format("({0},{1})", rowNum, cellNum);
        tempRow.Cells.Add(tempCell);
    }
    Table1.Rows.Add(tempRow);
}
' Create more rows for the table.
Dim rowNum As Integer
For rowNum = 2 To 9
    Dim tempRow As New TableRow()
    Dim cellNum As Integer
    For cellNum = 0 To 2
        Dim tempCell As New TableCell()
        tempCell.Text = _
            String.Format("({0},{1})", rowNum, cellNum)
        tempRow.Cells.Add(tempCell)
    Next
    Table1.Rows.Add(tempRow)
Next

備註

類別 TableRow.CellControlCollection 代表 控制項物件的 TableRow 集合 TableCellTableCell物件可以使用 方法或 方法的 AddAt TableRow.CellControlCollection 指定索引位置,在 集合 Add 結尾 TableRow.CellControlCollection 加入 物件。

只能 TableCell 將 物件新增至 TableRow.CellControlCollection 集合。

屬性

Count

取得指定 ASP.NET 伺服器控制項的 ControlCollection 物件中的伺服器控制項數目。

(繼承來源 ControlCollection)
IsReadOnly

取得值,這個值表示 ControlCollection 物件是否唯讀。

(繼承來源 ControlCollection)
IsSynchronized

取得值,該值指出是否同步處理 ControlCollection 物件。

(繼承來源 ControlCollection)
Item[Int32]

取得在 ControlCollection 物件中指定索引位置之伺服器控制項的參考。

(繼承來源 ControlCollection)
Owner

取得 ControlCollection 物件所屬的 ASP.NET 伺服器控制項。

(繼承來源 ControlCollection)
SyncRoot

取得可用來對控制項集合進行同步 (Synchronize) 存取的物件。

(繼承來源 ControlCollection)

方法

Add(Control)

將指定的 Control 物件加入至 TableRow.CellControlCollection 集合中。

AddAt(Int32, Control)

將指定的 Control 物件加入至 TableRow.CellControlCollection 集合中。 新控制項加入至指定索引位置的陣列。

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)

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

適用於

另請參閱