Skip to main content
Row

CellRange.GetRichText() Method

Gets the rich text string contained in a cell.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

RichTextString GetRichText()

Returns

Type Description
RichTextString

A RichTextString object that is a cell’s rich text.

Remarks

Use the CellRange.HasRichText property to check whether a cell contains rich formatted text. To retrieve rich text from a cell, use the GetRichText property.

For the cell where formatting is applied to a whole content, the GetRichText method returns a RichTextString with a single run containing only the cell text. The run’s RichTextRun.Font is null.

If a cell contains a non-textual value (for example, number or date), the returned RichTextString contains an empty text.

If you call the GetRichText method for a cell range, it returns a non-empty rich text only when all cells in this range have the same text with identical rich format settings; otherwise, GetRichText returns an empty text with an empty RichTextString.Runs collection.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetRichText() method.

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