Back to Devexpress

CellRange.HasRichText Property

officefileapi-devexpress-dot-spreadsheet-dot-cellrange-7a131e3a.md

latest2.9 KB
Original Source

CellRange.HasRichText Property

Gets a value indicating whether a cell contains rich formatted text.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
bool HasRichText { get; }
vb
ReadOnly Property HasRichText As Boolean

Property Value

TypeDescription
Boolean

true , if a cell contains rich formatted text; otherwise, false.

|

Remarks

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

For a cell range, the HasRichText property returns true only when all cells in this range have the same text with identical rich format settings; otherwise, it returns false.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the HasRichText 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.

winforms-spreadsheet-how-to-edit-rich-text/CS/SpreadsheetRichText/Form1.cs#L33

csharp
{
    if (e.Cell.HasRichText)
    {

winforms-spreadsheet-how-to-edit-rich-text/VB/SpreadsheetRichText/RichTextEditForm.vb#L14

vb
RichEditControl1.BeginUpdate()
If cell.HasRichText Then
    Dim richText As RichTextString = cell.GetRichText()

See Also

GetRichText()

How to: Apply Rich Formatting to Cell Text

CellRange Interface

CellRange Members

DevExpress.Spreadsheet Namespace