menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SpreadsheetTextBoxPaint - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SpreadsheetTextBoxPaint

    Inheritance
    System.Object
    SpreadsheetTextBoxPaint
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.UI.Xaml.Spreadsheet.Helpers
    Assembly: Syncfusion.SfSpreadsheet.WPF.dll
    Syntax
    public static class SpreadsheetTextBoxPaint

    Methods

    DrawFormattedText(SpreadsheetGrid, RowColumnIndex, DrawingContext, Rect, SpreadsheetColumn, Object)

    Draw the text using FormattedText

    Declaration
    public static void DrawFormattedText(SpreadsheetGrid grid, RowColumnIndex rowcolIndex, DrawingContext dc, Rect cellRect, SpreadsheetColumn column, object textElement)
    Parameters
    Type Name Description
    SpreadsheetGrid grid

    SpreadsheetGrid

    RowColumnIndex rowcolIndex

    RowColumnIndex

    System.Windows.Media.DrawingContext dc

    DrawingContext where the text is to be drawn

    System.Windows.Rect cellRect

    Rect of the cell

    SpreadsheetColumn column

    SpreadsheetColumn

    System.Object textElement

    TextElement(FormattedText), if already got while measuring the text

    DrawGlyphs(SpreadsheetGrid, RowColumnIndex, DrawingContext, Rect, SpreadsheetColumn, Object)

    Draw the text using GlyphRun, which is faster than DrawFormattedText.

    Declaration
    public static void DrawGlyphs(SpreadsheetGrid grid, RowColumnIndex rowcolIndex, DrawingContext dc, Rect cellRect, SpreadsheetColumn column, object textElement)
    Parameters
    Type Name Description
    SpreadsheetGrid grid

    SpreadsheetGrid

    RowColumnIndex rowcolIndex

    RowColumnIndex

    System.Windows.Media.DrawingContext dc

    DrawingContext where the text is to be drawn

    System.Windows.Rect cellRect

    Rect of the cell

    SpreadsheetColumn column

    SpreadsheetColumn

    System.Object textElement

    TextElement(GlyphRun), if already got while measuring the text

    DrawText(SpreadsheetGrid, RowColumnIndex, DrawingContext, Rect, SpreadsheetColumn, Object)

    Draw the text using GlyphRun or FormattedText based on the style and text.

    Declaration
    public static void DrawText(this SpreadsheetGrid grid, RowColumnIndex rowcolIndex, DrawingContext dc, Rect cellRect, SpreadsheetColumn column, object textElement)
    Parameters
    Type Name Description
    SpreadsheetGrid grid

    SpreadsheetGrid

    RowColumnIndex rowcolIndex

    RowColumnIndex

    System.Windows.Media.DrawingContext dc

    DrawingContext where the text is to be drawn

    System.Windows.Rect cellRect

    Rect of the cell

    SpreadsheetColumn column

    SpreadsheetColumn

    System.Object textElement

    TextElement(GlyphRun or FormattedText), if already got while measuring the text

    MeasureText(SpreadsheetGrid, String, SpreadsheetColumn, Double, Boolean, Int32, out Object)

    Measures the size of the text using either FormattedText or GlyphRun.

    Declaration
    public static Size MeasureText(this SpreadsheetGrid grid, string text, SpreadsheetColumn column, double cellWidth, bool wraptext, int lineCount, out object textElement)
    Parameters
    Type Name Description
    SpreadsheetGrid grid

    SpreadsheetGrid

    System.String text

    Text which size is to be measured

    SpreadsheetColumn column

    SpreadsheetColumn

    System.Double cellWidth

    Width of the cell

    System.Boolean wraptext

    True, if text is wrapped in a cell

    System.Int32 lineCount

    If text is wrapped, maximum possible line count

    System.Object textElement

    Returns the TextElement(GlyphRun or FormattedText) which used to measure

    Returns
    Type Description
    System.Windows.Size

    Size of the text

    MeasureTextUsingFormattedText(SpreadsheetGrid, String, IStyle, Double, Boolean, Int32, out Object)

    Measures the size of the text using FormattedText.

    Declaration
    public static Size MeasureTextUsingFormattedText(SpreadsheetGrid grid, string text, IStyle excelStyle, double cellWidth, bool wraptext, int lineCount, out object textElement)
    Parameters
    Type Name Description
    SpreadsheetGrid grid

    SpreadsheetGrid

    System.String text

    Text which size is to be measured

    IStyle excelStyle

    IStyle of the cell

    System.Double cellWidth

    Width of the cell

    System.Boolean wraptext

    True, if text is wrapped in a cell

    System.Int32 lineCount

    If text is wrapped, maximum possible line count

    System.Object textElement

    Returns the TextElement(FormattedText) which used to measure

    Returns
    Type Description
    System.Windows.Size

    Size of the text

    MeasureTextUsingGlyphs(SpreadsheetGrid, String, IStyle, out Boolean, out Object)

    Measures the size of the text using GlyphRun which is faster than FormattedText.

    Declaration
    public static Size MeasureTextUsingGlyphs(SpreadsheetGrid grid, string text, IStyle excelStyle, out bool isCalculated, out object textElement)
    Parameters
    Type Name Description
    SpreadsheetGrid grid

    SpreadsheetGrid

    System.String text

    Text which size is to be measured

    IStyle excelStyle

    IStyle of the cell

    System.Boolean isCalculated

    True, if size is calculated

    System.Object textElement

    Returns the TextElement(FormattedText) which used to measure

    Returns
    Type Description
    System.Windows.Size

    Size of the text

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved