System.Web.UI.WebControls Namespace TableCellCollection Class
Inserts a table cell at the specified index in a TableRow.Cells collection.
[ VB ]
Public Sub AddAt ( _
ByVal index As Integer, _
ByVal cell As TableCell _
)
[ C# ]
public void AddAt (
int index,
TableCell cell
);
[ C++ ]
public: void AddAt (
int index,
TableCell* cell
);
[ JScript ]
public function AddAt (
index : int,
cell : TableCell
);
- index
- The location in the collection in which to add the TableCell.
- cell
- The TableCell to insert into the location.
Use this method to insert a TableCell object at the specified index location in a TableCellCollection. If you need to append a TableCell to the end of the collection, use the Add method.
The following example demonstrates how to use the AddAt method to programmatically insert a TableCell at the specified index location in a TableRow.Cells collection.
// instantiate a new cell
TableCell cell = new TableCell ( );
// add cell content
cell.Text = "This is a table cell";
// add the cell to the Cells collection
myRow.Cells.AddAt ( 0, cell );
' instantiate a new cell
Dim cell As New TableCell ( )
' add cell content
cell.Text = "This is a table cell"
' add the cell to the Cells collection
myRow.Cells.AddAt ( 0, cell ) |
|
C# |
VB |
TableCellCollection Members Cells.Add Cells.Remove Cells.RemoveAt