TX Text Control .NET for Windows Forms Documentation

Table Class

An instance of the Table class represents a table in a Text Control document. It can be obtained from the document's table collection.

Syntax

[C#] public class Table
[Visual Basic] Public Class Table

Properties

PropertyDescription
CanMergeCellsChecks whether table cells can be merged.
CanSplitChecks whether this table can be split.
CanSplitCellsChecks whether previously merged table cells in this table can be split.
CellsGets a collection of all table cells the table consists of.
ColumnsGets a collection of all columns the table consists of.
IDGets or sets the table's identifier.
NestedLevelGets the nested level for the specified table.
NestedTablesGets a collection of all tables nested in this table.
OuterMostTableGets a table's outermost table.
OuterTableGets a table's outer table.
RowsGets a collection of all rows the table consists of.

Methods

MethodDescription
MergeCellsMerges all selected table cells in this table.
SelectSelects the complete table.
SplitSplits a table below or above the current input position.
SplitCellsSplits all selected table cells in this table.

Example

The following example shows how to split a table.

[C#] textControl1.ResetContents(); int myTableId = 10; textControl1.Tables.Add(10, 3, myTableId); TXTextControl.Table myTable = textControl1.Tables.GetItem(myTableId); textControl1.InputPosition = new TXTextControl.InputPosition(myTable.Cells.GetItem(3, 1).Start); if (myTable.CanSplit) myTable.Split(TXTextControl.TableAddPosition.After); // Correct the table IDs after splitting the original table. foreach (TXTextControl.Table myCurrentTable in textControl1.Tables) myCurrentTable.ID = myTableId++;
[Visual Basic] TextControl1.ResetContents() Dim MyTableId As Integer = 10 TextControl1.Tables.Add(10, 3, MyTableId) Dim MyTable As TXTextControl.Table = TextControl1.Tables.GetItem(MyTableId) TextControl1.InputPosition = _ New TXTextControl.InputPosition(MyTable.Cells.GetItem(3, 1).Start) If MyTable.CanSplit Then MyTable.Split(TXTextControl.TableAddPosition.After) End If ' Correct the table IDs after splitting the original table. For Each MyCurrentTable As TXTextControl.Table In TextControl1.Tables MyCurrentTable.ID = MyTableId MyTableId = MyTableId + 1 Next

See Also

 
 
 

Products

Support

Downloads

Corporate

Buy Now