TableCellCollection Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WinForms. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WinForms. SDK TXTextControl.from the setup.dll
- Inherits
- Table
Part Collection - Table
Cell Collection
- Table
- Implements
- ICollection, IEnumerable
Description
An instance of the TableCellCollection class contains all cells of a table in a Text Control document represented through TableCell objects. It can be obtained with the Table.Cells property. The TableCellCollection class implements the IEnumerable and the ICollection interfaces.
Syntax
public sealed class TableCellCollection : TablePartCollectionPublic NotInheritable Class TableCellCollection
Inherits TablePartCollectionExamples
The following example shows how to iterate over the table cell collection.
foreach (TXTextControl.TableCell myCell in myTable.Cells)
{
string myRow = myCell.Row.ToString();
string myCol = myCell.Column.ToString();
string myText = myCell.Text;
Console.WriteLine("({0},{1}): {2}", myRow, myCol, myText);
}For Each MyCell As TXTextControl.TableCell In MyTable.Cells
Dim MyRow As String = MyCell.Row.ToString()
Dim MyCol As String = MyCell.Column.ToString()
Dim MyText As String = MyCell.Text
Console.WriteLine("({0},{1}): {2}", MyRow, MyCol, MyText)
NextThe following example creates a small report table and works with its structure.
textControl.Tables.Add(3, 3, 10);
Table table = textControl.Tables.GetItem(10);
TableCellCollection tableCellCollection = table.Cells;textControl.Tables.Add(3, 3, 10)
Dim table As Table = textControl.Tables.GetItem(10)
Dim tableCellCollection As TableCellCollection = table.CellsMembers
Properties
| Property | Description |
|---|---|
| CanRemove | Gets a value indicating whether table cells can be removed. Table cells can be removed, if either the current text input position is in a table, or if a part of a table is selected. |
| 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 TableCell this[int row, int column] { get; } |
| SyncRoot | Gets an object that can be used to synchronize access to the collection. (Inherited from TablePartCollection.) |
Methods
| Method | Description |
|---|---|
| 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 cell from the collection. |
| Remove | Removes the table cell at the current text input position or all selected table cells when a text selection exists. |