Skip to main content
.NET Framework 4.5.2+

TableCollection.Create(DocumentPosition, Int32, Int32, AutoFitBehaviorType, 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.v22.2.Core.dll

NuGet Package: DevExpress.RichEdit.Core

Declaration

Table Create(
    DocumentPosition pos,
    int rowCount,
    int columnCount,
    AutoFitBehaviorType autoFitBehavior,
    int fixedColumnWidths
)

Parameters

Name Type Description
pos DocumentPosition

A DocumentPosition at which a table is inserted.

rowCount Int32

A number of table rows.

columnCount Int32

A number of table columns.

autoFitBehavior AutoFitBehaviorType

Indicates the AutoFit layout algorithm type.

fixedColumnWidths Int32

The column width if the autoFitBehavior parameter is set to FixedColumnWidth.

Returns

Type Description
Table

The newly created table.

Remarks

Right-to-Left Direction in Tables

The inserted table’s text direction depends on the RightToLeft property value of a paragraph where the table should be inserted. If the paragraph’s RightToLeft property is set to true, the table’s RightToLeft property is automatically set to true. The RightToLeft property of all cell paragraphs is also set to true.

Use the ReadOnlyParagraphCollection.Get(DocumentPosition) method to obtain the paragraph where the DocumentPosition is located.

Successive Tables

When you call the Create method to insert a new table right before or after the existing table, these tables are merged and the Create method returns the resulting table. Successive tables with different directions are not merged.

Set the RichEditControlCompatibility.MergeSuccessiveTables property to false to keep successive tables with the same direction separate.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Create(DocumentPosition, Int32, Int32, AutoFitBehaviorType, 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.

See Also