TableCollection.Create(DocumentPosition, Int32, Int32) Method
Inserts a blank table with the specified number of rows and columns at the specified position.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v20.2.Core.dll
NuGet Package: DevExpress.RichEdit.Core
NuGet Packages: DevExpress.RichEdit.Core, DevExpress.WindowsDesktop.RichEdit.Core
Declaration
Parameters
Name | Type | Description |
---|---|---|
pos | DocumentPosition | A DocumentPosition at which a table is inserted. |
rowCount | Int32 | An integer specifying the number of rows in a new table. |
columnCount | Int32 | An integer specifying the number of columns in a new table. |
Returns
Type | Description |
---|---|
Table | A Table interface specifying the newly created table. |
Example
The code sample below creates a table with three columns and four rows:
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
Document document = wordProcessor.Document;
// Create a new table
Table table = document.Tables.Create(document.Range.End, 2, 2);
// Add new rows to the table
table.Rows.InsertBefore(0);
table.Rows.InsertAfter(0);
// Add a new column to the table
table.Rows[0].Cells.Append()
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the Create(DocumentPosition, Int32, Int32) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.