How to Clone a Table Row Using TX Text Control .NET for Windows Forms
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…

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;
}Related Posts
Convert CSV to PDF in .NET C#
Learn how to convert CSV data to a table in C# using the ServerTextControl library with this step-by-step tutorial. Easily generate PDF documents from CSV files in your .NET applications.
Why Table Control in Templates is Important for Professional PDF Creation in C#
Controlling how tables behave at page breaks is an important factor in creating professional-looking documents. This article discusses the importance of table control in templates for PDF generation.
ASP.NETWindows FormsASP.NET Core
Splitting Tables at Bookmark Positions and Cloning Table Headers
This article shows how to split tables at bookmark positions and how to clone table headers in TX Text Control .NET for Windows Forms and TX Text Control .NET Server.
Loading and Processing Excel XLSX Spreadsheet Tables into TX Text Control…
TX Text Control provides a powerful API to load and process Excel spreadsheet tables in .NET applications. This article shows how to load an Excel file and process the tables using TX Text Control…
Creating Advanced Tables in PDF and DOCX Documents with C#
This article shows how to create advanced tables in PDF and DOCX documents using the TX Text Control .NET for ASP.NET Server component. This article shows how to create tables from scratch,…
