TX Text Control .NET for WPF

Add Method

Method
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Adds a new table column at the current text input position.

Syntax

public bool Add(TableAddPosition position);

Parameters

ParameterDescription
position

Specifies the position where to add the column. It can be one of the TableAddPosition values:

ValueMeaning
BeforeThe column is inserted left of the column with the current input position.
AfterThe column is inserted right of the column with the current input position.

Return Value

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

Examples

The following example creates a small report table and works with its structure by using TableColumnCollection.Add.

textControl.Tables.Add(3, 3, 10);
Table table = textControl.Tables.GetItem(10);
TableColumnCollection tableColumnCollection = table.Columns;

if (!tableColumnCollection.Add(TableAddPosition.After))
{
    throw new InvalidOperationException("The item could not be inserted.");
}