Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Table.MergeCells(TableCell, TableCell) Method

Merges the cells in the specified range into a single cell.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v24.2.Core.dll

NuGet Package: DevExpress.RichEdit.Core

#Declaration

void MergeCells(
    TableCell mergeFrom,
    TableCell mergeTo
)

#Parameters

Name Type Description
mergeFrom TableCell

A TableCell that marks one end of the merged range.

mergeTo TableCell

A TableCell that marks the opposite end of the merged range.

#Remarks

All cells that fall within a table range marked by specified cells (including them) are merged into a single cell. The order in which cells are specified as method arguments does not matter.

#Example

This code snippet performs the following:

  • creates a table containing 6 rows and 8 columns
  • merges cells horizontally in the third row from the third to the sixth column
  • merges cells vertically in the third column from the fourth to the eighth row

View Example

Document document = server.Document;
Table table = document.Tables.Create(document.Range.Start, 6, 8);
table.BeginUpdate();
table.MergeCells(table[2, 1], table[5, 1]);
table.MergeCells(table[2, 3], table[2, 7]);
table.EndUpdate();

The following code snippets (auto-collected from DevExpress Examples) contain references to the MergeCells(TableCell, TableCell) 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