TableRowCollection Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WPF. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WPF. SDK TXTextControl.from the setup.dll
- Inherits
- Table
Part Collection - Table
Row Collection
- Table
- 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 : TablePartCollectionPublic NotInheritable Class TableRowCollection
Inherits TablePartCollectionExamples
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();Dim MyLastRow As Integer = myTable.Rows.Count
Dim MyRow As TXTextControl.TableRow = MyTable.Rows.GetItem(MyLastRow)
MyRow.Select()
If MyTable.Rows.CanRemove Then
MyTable.Rows.Remove()
End IfThe 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;textControl.Tables.Add(3, 3, 10)
Dim table As Table = textControl.Tables.GetItem(10)
Dim tableRowCollection As TableRowCollection = table.RowsMembers
Properties
| Property | Description |
|---|---|
| CanAdd | 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. |
| CanRemove | Gets a value indicating whether selected rows can be removed. |
| Count | Gets the number of elements contained in the collection. (Inherited from TablePartCollection.) |
| IsSynchronized | Returns true if the collection is designed to be thread safe, otherwise, it returns false. (Inherited from TablePartCollection.) |
| Item | Not described in the reference. public TableRow this[int row] { get; } |
| SyncRoot | Gets an object that can be used to synchronize access to the collection. (Inherited from TablePartCollection.) |
Methods
| Method | Description |
|---|---|
| Add | Adds new table rows at the current text input position. |
| CopyTo | Copies the elements of the collection to an array, starting at a particular index. |
| GetEnumerator | Returns an enumerator that can be used to iterate through the collection. (Inherited from TablePartCollection.) |
| GetItem | Gets a particular table row from the collection. |
| Remove | Removes the selected table rows or the row at the current text input position. |