Skip to main content
.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.v22.1.Core.dll

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

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