TX Text Control .NET Server

TableCollection Class

Class
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.Core.dll
Install
dotnet add package TXTextControl.TextControl.Core.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll
Inherits
  1. TableBaseCollection
  2. TableCollection
Implements
ICollection, IEnumerable

Description

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:

Syntax

public sealed class TableCollection : TableBaseCollection

Examples

The following example shows how to handle the table collection.

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

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

TXTextControl.Table myTable = textControl1.Tables.GetItem(myTableId);
textControl1.Tables.Remove(myTableId);

The following example works with tables in the current document.

TableCollection tableCollection = textControl.Tables;
tableCollection.Add(3, 3, 10);

Members

Properties

PropertyDescription
CanAddGets a value indicating whether a new table can be inserted at the current input position. This property does not check for protected TextFields and/or protected document sections. To perform this use in addition the TextControl.CanEdit property.
CountGets the number of tables contained in the collection. (Inherited from TableBaseCollection.)
GridLinesGets or sets a value indicating wether table grid lines are shown or not.
IsSynchronizedReturns true if the collection is designed to be thread safe, otherwise, it returns false. (Inherited from TableBaseCollection.)
SupportedFormulaFunctionsGets a list of all formula functions currently supported. These functions are listed in Supported Formula Functions. For more information how to construct a formula with predefined functions see Using Formulas in Table Cells.
SupportedNumberFormatsGets a list of often used number formats for formula results. See Formatting Text by using Number Formats for more information about number format strings.
SyncRootGets an object that can be used to synchronize access to the collection. (Inherited from TableBaseCollection.)

Methods

MethodDescription
AddAdds a new table at the current text input position.
ClearRemoves all tables contained in the collection from a Text Control document. (Inherited from TableBaseCollection.)
CopyToCopies the elements of the collection to an array, starting at a particular index. (Inherited from TableBaseCollection.)
GetEnumeratorReturns an enumerator that can be used to iterate through the collection. (Inherited from TableBaseCollection.)
GetItemGets the table at the current input position. To get a particular table with a certain identifier use the base class's implementation TableBaseCollection.GetItem.
GetItemGets a particular table from the collection. (Inherited from TableBaseCollection.)
RemoveRemoves the table at the current text input position. To remove a particular table with a certain identifier use the base class's implementation TableBaseCollection.Remove.
RemoveRemoves a particular table from the collection. (Inherited from TableBaseCollection.)