An instance of the TableRowCollection class contains all rows of a table in a Text Control document represented through objects of the type TableRow. It can be obtained with the Table.Rows property. The TableRowCollection class implements the IEnumerable and the ICollection interfaces.

Syntax

public sealed class TableRowCollection: TablePartCollection
Public NotInheritable Class TableRowCollection
  Inherits TablePartCollection

Examples

The following example shows how to handle the table row collection.

int myLastRow = myTable.Rows.Count;
TXTextControl.TableRow myRow = myTable.Rows.GetItem(myLastRow);
myRow.Select();

if(myTable.Rows.CanRemove)
    myTable.Rows.Remove();
Dim MyLastRow As Integer = myTable.Rows.Count
Dim MyRow As TXTextControl.TableRow = MyTable.Rows.GetItem(MyLastRow)
MyRow.Select()

If MyTable.Rows.CanRemove Then
    MyTable.Rows.Remove()
End If

Methods

Method Description
Add Adds new table rows at the current text input position.
CopyTo Copies the elements of the collection to an array, starting at a particular index.
GetEnumerator Returns an enumerator that can be used to iterate through the collection.
(Inherited from TablePartCollection)
GetItem Gets a particular table row from the collection.
Remove Removes the selected table rows or the row at the current text input position.

Properties

Property Description
CanAdd Gets a value indicating whether a new row can be inserted at the current input position.
CanRemove Gets a value indicating whether selected rows can be removed.
Count Gets the number of elements contained in the collection.
(Inherited from TablePartCollection)
IsSynchronized Returns true if the collection is designed to be thread safe, otherwise, it returns false.
(Inherited from TablePartCollection)
SyncRoot Gets an object that can be used to synchronize access to the collection.
(Inherited from TablePartCollection)