.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

TableCell.ContentRange Property

Gets the document range occupied by the cell content.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v21.1.Core.dll

Declaration

DocumentRange ContentRange { get; }

Property Value

Type Description
DocumentRange

A DocumentRange that is the target range.

Remarks

The ContentRange property returns the range that represents the cell content. Use the Range property to obtain the range occupied by the whole table cell. The image below illustrates the difference between these two values:

IMAGE

Use the ContentRange property to apply formatting to the cell content, as shown below:

Table table = document.Tables[0];

//Apply formatting to the first cell
CharacterProperties properties = document.BeginUpdateCharacters(table[0, 1].ContentRange);
properties.FontName = "Segoe UI";
properties.FontSize = 16;
document.EndUpdateCharacters(properties);
ParagraphProperties alignment = document.BeginUpdateParagraphs(table[0, 1].ContentRange);
alignment.Alignment = ParagraphAlignment.Center;
document.EndUpdateParagraphs(alignment);
See Also