TX Text Control .NET for Windows Forms

CanAdd Property

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

Description

Gets a value indicating whether a new row 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.

Syntax

public bool CanAdd { get; }

Examples

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

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

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

Limitations

Read only.