Class RichTextBoxHelper
Helper class which maintains the richtextbox operations involving the editing, conversion of rich text into flow document and drawing of richtext box in the specified cell of SfSpreadsheet.
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.Spreadsheet.Helpers
Assembly: Syncfusion.SfSpreadsheet.WPF.dll
Syntax
public static class RichTextBoxHelper
Methods
AppendFormat(SpreadsheetGrid, IFont, Run)
This method returns System.Windows.Documents.Run which append the next character when both have same font format.
Declaration
public static Run AppendFormat(SpreadsheetGrid grid, IFont charfont, Run run)
Parameters
| Type | Name | Description |
|---|---|---|
| SpreadsheetGrid | grid | An instance of SpreadsheetGrid. |
| IFont | charfont | An instance of IFont. |
| System.Windows.Documents.Run | run | An instance of System.Windows.Documents.Run. |
Returns
| Type |
|---|
| System.Windows.Documents.Run |
ConvertRichTextToFlowDocument(SpreadsheetGrid, IStyle, IRichTextString)
Create the flowdocument from the richtext of required content.
Declaration
public static FlowDocument ConvertRichTextToFlowDocument(this SpreadsheetGrid grid, IStyle excelstyle, IRichTextString richText)
Parameters
| Type | Name | Description |
|---|---|---|
| SpreadsheetGrid | grid | An instance of SpreadsheetGrid. |
| IStyle | excelstyle | Styles of current excelrange. |
| IRichTextString | richText | The richtext string. |
Returns
| Type | Description |
|---|---|
| System.Windows.Documents.FlowDocument | The flow conent of the text. |
DrawRichText(DrawingContext, Rect, FlowDocument, IStyle)
Draw the richtextbox with specified flow content and style in the particular range.
Declaration
public static void DrawRichText(DrawingContext dc, Rect rc, FlowDocument document, IStyle excelstyle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Media.DrawingContext | dc | An instance of System.Windows.Media.DrawingContext. |
| System.Windows.Rect | rc | An instance System.Windows.Rect of cell. |
| System.Windows.Documents.FlowDocument | document | An instance of System.Windows.Documents.FlowDocument. |
| IStyle | excelstyle | An instance of IStyle. |
SetRichTextString(SpreadsheetGrid, IRichTextString, FlowDocument, String)
Sets the rich text string in the specified SpreadsheetGrid.
Declaration
public static void SetRichTextString(SpreadsheetGrid grid, IRichTextString richText, FlowDocument flowdocument, string formattedtext)
Parameters
| Type | Name | Description |
|---|---|---|
| SpreadsheetGrid | grid | An instance of SpreadsheetGrid. |
| IRichTextString | richText | The rich text string. |
| System.Windows.Documents.FlowDocument | flowdocument | An instance of System.Windows.Documents.FlowDocument. |
| System.String | formattedtext | Specified text. |