TXTextControl.TableRowCollection Class

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

[C#]
public sealed class TableRowCollection: TablePartCollection
[Visual Basic]
Public NotInheritable Class TableRowCollection
  Inherits TablePartCollection

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.)

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 Overloaded. Gets a particular table row from the collection.
Remove Removes the selected table rows or the row at the current text input position.

Example

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

[C#]
int myLastRow = myTable.Rows.Count;
TXTextControl.TableRow myRow = myTable.Rows.GetItem(myLastRow);
myRow.Select();

if(myTable.Rows.CanRemove)
  myTable.Rows.Remove();
[Visual Basic]
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

See Also