TXTextControl.TableCollection Class

An instance of the TableCollection class contains all tables of a Text Control document or part of the document represented through objects of the type Table. It can be obtained with the TextControl.Tables, HeaderFooter.Tables or TextFrame.Tables property. The TableCollection class is derived from the TableBaseCollection class and implements therefore the IEnumerable and the ICollection interfaces. Additionally to the properties and methods inherited it implements the following:


public sealed class TableCollection: TableBaseCollection
[Visual Basic]
Public NotInheritable Class TableCollection
  Inherits TableBaseCollection


Property Description
CanAdd Gets a value indicating whether a new table can be inserted at the current input position.
GridLines Gets or sets a value indicating wether table grid lines are shown or not.
SupportedFormulaFunctions Gets a list of all formula functions currently supported.
SupportedNumberFormats Gets a list of often used number formats for formula results.


Method Description
Add Overloaded. Adds a new table at the current text input position.
GetItem Gets the table at the current input position.
Remove Removes the table at the current text input position.


The following example shows how to handle the table collection.

int myTableId = 10;
textControl1.Tables.GridLines = false;

    textControl1.Tables.Add(5, 3, myTableId);

TXTextControl.Table myTable = textControl1.Tables.GetItem(myTableId);
[Visual Basic]
Dim MyTableId As Integer = 10
TextControl1.Tables.GridLines = False

If TextControl1.Tables.CanAdd Then
    TextControl1.Tables.Add(5, 3, MyTableId)
End If

Dim MyTable As TXTextControl.Table = TextControl1.Tables.GetItem(MyTableId)

See Also