TableRow.CellControlCollection 类    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
protected: ref class TableRow::CellControlCollection : System::Web::UI::ControlCollectionprotected class TableRow.CellControlCollection : System.Web.UI.ControlCollectionProtected Class TableRow.CellControlCollection
Inherits ControlCollection- 继承
示例
下面的代码示例演示如何创建表、以编程方式向表添加元素,然后在网页上显示该表。 请注意控件的属性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集合TableCell。 TableCell可以使用该方法或方法中的TableRow.CellControlCollectionAddAt指定索引位置在集合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 | 获取可用于同步控件集合访问的对象。(继承自 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。 |