Class CellContentSizeHelper
Represents a helper class for measuring the cell content size.
Inheritance
Inherited Members
Namespace: Telerik.Documents.SpreadsheetStreaming
Assembly: Telerik.Documents.SpreadsheetStreaming.dll
Syntax
public static class CellContentSizeHelper
Methods
GetCellContentSize(String, String, String, Double, Boolean, Boolean, SpreadHorizontalAlignment, Boolean, Int32, Double)
The method calculates the cell content size based on the cell formatting. The result can be used to set the column width so the values can fit in the columns.
Declaration
public static Size GetCellContentSize(string value, string cellValueFormat, string fontFamily, double fontSize, bool isBold, bool isItalic, SpreadHorizontalAlignment horizontalAlignment, bool isWrapped, int indent, double cellWidth = 65)
Parameters
System. The cell value. If formula is passed the method will throw an ArgumentException. |
System. The number format of the cell. |
System. The font family. |
System. The size of the font in points. |
System. A value indicating whether the text is bold. |
System. A value indicating whether the text is italic. |
Spread The horizontal alignment. |
System. A value indicating whether the text is wrapped. |
System. The cell indent. |
System. The width of the cell in pixels. This value is only respected if the value of isWrapped is true. The default column width is 65 pixels. |
Returns
System. The size of the cell content. |
GetCellContentSize(String, SpreadCellFormat, Double)
The method calculates the cell content size based on the cell formatting. The result can be used to set the column width so the values can fit in the columns.
Declaration
public static Size GetCellContentSize(string value, SpreadCellFormat spreadCellFormat, double cellWidth = 65)
Parameters
System. The cell value. If formula is passed the method will throw an ArgumentException. |
Spread The format of the cell. |
System. The width of the cell in pixels. This value is only respected if the value of the WrapText property of the spreadCellFormat is true. The default column width is 65 pixels. |
Returns
System. The size of the cell content. |