$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
RichTextBox Control for Windows Forms
Edit rich text content with text formatting options, mail-merge, table, and floating objects, etc.
Home > WinForms UI Controls > User Manual > RichTextBox Table Element in C#

Display Tables in Document of RichTextBox in C#.NET

KetticRichTextBox control allows the users to add tables to the document in their Windows Forms applications through the C# API included in the component. The KetticRichTextBox table consists of three C# classes, Table, TableRow and TableCell. The Table C# class is used to define the table. The TableRow C# class is used to define the child object of the KetticRichTextBox table. The TableCell C# class is used to define the child object of the TableRow and accepts block elements as child object.

Adding/Removing Table using C# API of KetticRichTextBox

KetticRichTextBox offers a rich C# API of table for the users of the control to add and remove tables that are displayed in the KetticDocument. The users can connect the methods included in the C# API with a user interface to execute user interaction with the user interface. The following are the methods available within the C# API of KetticRichTextBox.
  • RemoveTable, this method is used to remove the table selected currently.
  • RemoveColumnfromTable, this method is used to remove column selected currently from the table
  • RemoveRowfromTable, this method is used to remove the row selected currently from the table.
  • AddTable, this method is able to add a table and assign the number of rows and columns to the table.
  • AddColumntoTable, this method is used to add a column at the end of the columns in a table.
  • AddTableColumnToTheLeft, this method is used to add a column to the left of the current column selected in a table.
  • AddTableColumnToTheRight, this method is used to add a column to the right of the current column selected in a table.
  • AddTableRow, this method is able to add a row at the end of the rows in a table.
  • AddRowAboveTable, this method is used to add a row above the current row selected in a table.
  • AddRowBelowTable, this method is used to add a row below the current row selected in a table.
In addition, the TableCell object of the KetticRichTextBox contains the RowSpan and ColumnSpan properties for the users to span cells in columns and rows and LayoutMode property for the users to specify the layout mode for the table of KetticDocument. The LayoutMode property includes two valid values, Fixed and AutoFit. The Fixed value assigns the table width to equal to the property, PrefferedWidth and the AutoFit property assigns the table to fit to the entire space available in the horizontal direction.

Create a Table through UI in KetticDocument

KetticRichTextBox .NET component provides the AddTableDialog for the users to insert a table to KetticDocument. To use the dialog, we should call the DisplayAddTableDialog() method in KetticRichTextBox control.

Format a Table through C# API of KetticRichTextBox at Runtime

KetticRichTextBox offers a rich C# API of table for the users of the control to customize tables that are shown in the KetticDocument. The following are the methods for customizing tables included in the C# API of KetticRichTextBox.
  • ModifyBordersofTable, this method is used to customize the table borders selected currently through a TableBorders object.
  • ModifyAlignmentofTableCellContent, this method is used to set the alignment of the content in a cell
  • ModifyBackgroundofTableCell, this method is able to define the color of the cell background selected currently
  • ModifyPaddingofTableCell, this method is used to customize modifies the padding of the currently selected cell.
  • ModifyBordersofTableCell, this method is able to customize table borders selected currently through a TableCellBorders object
  • MergeTableCells, this method is used to merge cells selected currently
  • ModifyLayoutModeofTableColumns, this method is able to set the column layout mode of the table.
  • ModifyColumnWidthofTableGrid, this method is used to customize the column width in a table
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls