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

TableCell.Range Property

Gets a document range that contains the cell content, including the table paragraph mark.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

Declaration

DocumentRange Range { get; }

Property Value

Type Description
DocumentRange

A range with the cell content.

Remarks

The Range property returns the range with the whole cell (including the table paragraph mark). The ContentRange property returns the range occupied by the cell content.

The image below illustrates the difference between Range and ContentRange values:

IMAGE

Use the Range property to format cell content, as shown below:

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

  // Insert text to the cell
  document.InsertSingleLineText(headerCell.Range.Start, "Active Customers");

  // Apply formatting to the "Active Customers" cell
  CharacterProperties properties =
       document.BeginUpdateCharacters(headerCell.Range);
  properties.FontName = "Segoe UI";
  properties.FontSize = 16;
  document.EndUpdateCharacters(properties);
}
See Also