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.v23.2.Core.dll
NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation
Declaration
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:
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);
}
Related GitHub Examples
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.