TableRowCollection Class
Encapsulates a collection of TableRow objects that represent a single row in a Table control. This class cannot be inherited.
Assembly: System.Web (in System.Web.dll)
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of TableRow objects in the TableRowCollection. |
![]() | IsReadOnly | Gets a value indicating whether the TableRowCollection is read-only. |
![]() | IsSynchronized | Gets a value indicating whether access to the TableRowCollection is synchronized (thread-safe). |
![]() | Item[Int32] | Gets a TableRow from the TableRowCollection at the specified index. |
![]() | SyncRoot | Gets the object that can be used to synchronize access to the TableRowCollection. |
| Name | Description | |
|---|---|---|
![]() | Add(TableRow^) | Appends the specified TableRow object to the end of the TableRowCollection. |
![]() | AddAt(Int32, TableRow^) | Adds the specified TableRow object to the TableRowCollection at the specified index location. |
![]() | AddRange(array<TableRow^>^) | Appends the TableRow objects from the specified array to the end of the collection. |
![]() | Clear() | Removes all TableRow controls from the TableRowCollection. |
![]() | CopyTo(Array^, Int32) | Copies the items from the TableRowCollection to the specified System::Array, starting with the specified index in the System::Array. |
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetEnumerator() | Returns a System.Collections::IEnumerator implemented object that contains all TableRow objects within the TableRowCollection. |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetRowIndex(TableRow^) | Returns a value that represents the index of the specified TableRow from the TableRowCollection. |
![]() | GetType() | |
![]() | Remove(TableRow^) | Removes the specified TableRow from the TableRowCollection. |
![]() | RemoveAt(Int32) | Removes a TableRow from the TableRowCollection at the specified index. |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IList::Add(Object^) | This API supports the product infrastructure and is not intended to be used directly from your code. Adds an object to the collection. |
![]() ![]() | IList::Contains(Object^) | This API supports the product infrastructure and is not intended to be used directly from your code. Determines whether the specified object is contained within the collection. |
![]() ![]() | IList::IndexOf(Object^) | This API supports the product infrastructure and is not intended to be used directly from your code. Searches for the specified object and returns the zero-based index of the first occurrence within the collection. |
![]() ![]() | IList::Insert(Int32, Object^) | This API supports the product infrastructure and is not intended to be used directly from your code. Inserts an object into the collection at the specified index. |
![]() ![]() | IList::Remove(Object^) | This API supports the product infrastructure and is not intended to be used directly from your code. Removes an object from the collection. |
![]() ![]() | IList::IsFixedSize | This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IsFixedSize. |
![]() ![]() | IList::Item[Int32] | This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see Item. |
| Name | Description | |
|---|---|---|
![]() | AsParallel() | Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.) |
![]() | AsQueryable() | Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.) |
![]() | Cast<TResult>() | Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.) |
![]() | OfType<TResult>() | Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.) |
Use this class to programmatically manage a collection of TableRow objects. This class is commonly used to add or remove rows from a Table control.
Note |
|---|
A Table control contains a Rows collection that represents a collection of TableRow objects. Each TableRow represents an individual row in the table and contains a Cells collection that represents a collection of TableCell objects. These TableCell objects represent the individual cells in the table. To get an individual cell, you must first get a TableRow from the Rows collection of a Table control. You can then get a TableCell from the Cells collection of the TableRow. |
The following example demonstrates how to programmatically add rows to a table by adding TableRow objects, which represent the rows of the table, to the Table control through the Rows property.
<html> <head> <script language="C#" 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><font face="Verdana">Table Example, constructed programmatically</font></h3> <form runat=server> <asp:Table id="Table1" runat="server"/> </form> </body> </html>
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.





