I found this solution by reviewing our recent support cases. A user wanted to know how to clone a specific table row without adding a new table row and copying the cell's content.

The solution is quite easy. You can simply select the complete table row in order to save the row to memory using Selection.Save. On loading it again, the new table row will be added at the current input position. Same results, but much easier.

The following code can be used to clone the table row at the current input position:

// [C#]
private bool CloneTableRow()
{
 textControl1.Selection.Length = 0;

 TXTextControl.Table curTable = textControl1.Tables.GetItem();
 if (curTable == null)
  return false;

 curTable.Rows.GetItem().Select();

 byte[] rowData;
 textControl1.Selection.Save(out rowData,
              TXTextControl.BinaryStreamType.InternalUnicodeFormat);
 textControl1.Selection.Length = 0;
 textControl1.Selection.Load(rowData,
              TXTextControl.BinaryStreamType.InternalUnicodeFormat);

 return true;
}