Edit this page
Available for: UI for ASP.NET AJAX | UI for ASP.NET MVC | UI for WPF | UI for WinForms | UI for Silverlight

TableRow

TableRow class represents a single row in a Table. Each row contains a collection of TableCell instances.

Inserting a Row

You can easily add a TableRow instance by using the AddTableRow() method of the Table class.

The code snippet in Example 1 shows how to create a table and add a single row to it.

[C#] Example 1: Create TableRow

Table table = new Table();
TableRow tableRow = table.Rows.AddTableRow();

Using TableCellCollection

In order to manipulate the cells in a row you can use TableRow's Cells property. The property represents the collection of cells added to this row and provides easy access to each of them.

Example 2 shows how to add two cells in a row and get the cells count.

[C#] Example 2: Access cells in a TableRow

TableCell firstCell = tableRow.Cells.AddTableCell();
TableCell secondCell = tableRow.Cells.AddTableCell();
int cellsInRowCount = tableRow.Cells.Count;

See Also