TX Text Control .NET for Windows Forms

Add Method

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

Description

Adds new table rows at the current text input position.

Syntax

public bool Add(TableAddPosition position, int count);

Parameters

ParameterDescription
position

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

ValueMeaning
BeforeThe rows are inserted in front of the row with the current input position.
AfterThe rows are inserted behind the row with the current input position.
count

Specifies the number of rows to add.

Return Value

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

Examples

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

textControl.Tables.Add(3, 3, 10);
Table table = textControl.Tables.GetItem(10);
TableRowCollection tableRowCollection = table.Rows;

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