TX Text Control .NET for WPF

TableRowCollection Class

Class
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Inherits
  1. TablePartCollection
  2. TableRowCollection
Implements
ICollection, IEnumerable

Description

An instance of the TableRowCollection class contains all rows of a table in a Text Control document represented through objects of the type TableRow. It can be obtained with the Table.Rows property. The TableRowCollection class implements the IEnumerable and the ICollection interfaces.

Syntax

public sealed class TableRowCollection : TablePartCollection

Examples

The following example shows how to handle the table row collection.

int myLastRow = myTable.Rows.Count;
TXTextControl.TableRow myRow = myTable.Rows.GetItem(myLastRow);
myRow.Select();

if(myTable.Rows.CanRemove)
    myTable.Rows.Remove();

The following example creates a small report table and works with its structure.

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

Members

Properties

PropertyDescription
CanAddGets 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.
CanRemoveGets a value indicating whether selected rows can be removed.
CountGets the number of elements contained in the collection. (Inherited from TablePartCollection.)
IsSynchronizedReturns true if the collection is designed to be thread safe, otherwise, it returns false. (Inherited from TablePartCollection.)
ItemNot described in the reference. public TableRow this[int row] { get; }
SyncRootGets an object that can be used to synchronize access to the collection. (Inherited from TablePartCollection.)

Methods

MethodDescription
AddAdds new table rows at the current text input position.
CopyToCopies the elements of the collection to an array, starting at a particular index.
GetEnumeratorReturns an enumerator that can be used to iterate through the collection. (Inherited from TablePartCollection.)
GetItemGets a particular table row from the collection.
RemoveRemoves the selected table rows or the row at the current text input position.