TX Text Control .NET Server

Add Method

Method
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Adds a new table at the current text input position.

Syntax

Add()

Opens a dialog box and, when left with Ok, adds a new table with the specified attributes.

public bool Add();

Add(int, int)

Adds a new table at the current text input position. The new table has the specified number of rows and columns.

public bool Add(int rows, int columns);
ParameterDescription
rows

Specifies the number of rows the table consists of.

columns

Specifies the number of columns the table consists of.

Add(int, int, int)

Adds a new table at the current text input position. The new table has the specified number of rows and columns. The specified identifier can be used to get the table from the collection.

public bool Add(int rows, int columns, int id);
ParameterDescription
rows

Specifies the number of rows the table consists of.

columns

Specifies the number of columns the table consists of.

id

Specifies the table's id.

Return Value

The return value is true, if the table could be added. Otherwise it is false.

Examples

The following example works with tables in the current document by using TableCollection.Add.

TableCollection tableCollection = textControl.Tables;

if (!tableCollection.Add(1, 1, 100))
{
    throw new InvalidOperationException("The item could not be inserted.");
}