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

TableCell.Range Property

Gets a document range occupied by the current cell.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

DocumentRange Range { get; }

Property Value

Type Description
DocumentRange

A DocumentRange occupied by a cell.

Remarks

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

IMAGE

Use the Range property to insert content to the cell, and the ContentRange property to format the cell content:

using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
    Document document = wordProcessor.Document;
    Table table = document.Tables[0];

    //Insert the header data
    document.InsertSingleLineText(table.Rows[0].Cells[1].Range.Start, "Active Customers");

    //Apply formatting to the "Active Customers" cell
    CharacterProperties properties = document.BeginUpdateCharacters(table[0, 1].ContentRange);
    properties.FontName = "Segoe UI";
    properties.FontSize = 16;
    document.EndUpdateCharacters(properties);
}
See Also