Skip to main content
Row

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SpreadsheetFontProperties Interface

Contains font attributes for a range of characters within the cell text.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

public interface SpreadsheetFontProperties

The following members return SpreadsheetFontProperties objects:

#Remarks

Use the SpreadsheetFontProperties object’s properties to view or change font characteristics for a portion of cell text specified by the RichTextString.Characters method. This method returns the RichTextRange object that represents the text subset and allows you to set its font characteristics using the RichTextRange.Font property.

// Set a cell value.
worksheet["B2"].Value = "Rich text formatting";

// Obtain the RichTextString object containing the cell text.
RichTextString richText = worksheet["B2"].GetRichText();
// Format the first word as bold. 
richText.Characters(0, 4).Font.Bold = true;

// Assign the rich formatted text to the cell B2.
worksheet["B2"].SetRichText(richText);

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

See Also