Skip to main content
Row

RichTextString.Text Property

Gets or sets the full text of a cell.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

public string Text { get; set; }

Property Value

Type Description
String

A String value that specifies the text displayed in a cell.

Remarks

A worksheet cell may contain rich formatted text that represents a cell text divided into separate regions (so-called text runs), each with its own set of font characteristics. The Text property allows you to obtain the entire text string contained in a cell. If there are several runs within the cell text, the Text property returns a string that combines all text regions specified by these runs. To obtain the text length, use the RichTextString.Length property.

If you set this property to a new value, all the existing text runs in the RichTextString.Runs collection will be replaced with a single run that holds the full cell text formatted with the default font. You can use the RichTextString.Characters method overloads to format specific characters within the cell text.

For more information on how to apply different fonts to specific regions of the cell text, refer to the How to: Apply Rich Formatting to Cell Text example.

See Also