Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

TableCell.Range Property

Gets a document range occupied by the current cell.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

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);
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the Range property.

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