skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
  • Docs & Support
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class CellContentSizeHelper

Represents a helper class for measuring the cell content size.

Inheritance
System.Object
CellContentSizeHelper
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
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.String value

The cell value. If formula is passed the method will throw an ArgumentException.

System.String cellValueFormat

The number format of the cell.

System.String fontFamily

The font family.

System.Double fontSize

The size of the font in points.

System.Boolean isBold

A value indicating whether the text is bold.

System.Boolean isItalic

A value indicating whether the text is italic.

SpreadHorizontalAlignment horizontalAlignment

The horizontal alignment.

System.Boolean isWrapped

A value indicating whether the text is wrapped.

System.Int32 indent

The cell indent.

System.Double cellWidth

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.Windows.Size

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.String value

The cell value. If formula is passed the method will throw an ArgumentException.

SpreadCellFormat spreadCellFormat

The format of the cell.

System.Double cellWidth

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.Windows.Size

The size of the cell content.

Getting Started
  • Getting Started
Support Resources
  • Documentation
Community
  • Forums
  • Blogs
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.