GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    ExcelRow Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Excel row contains row options and cell range with row cells.

    • C#
    • VB.NET
    public sealed class ExcelRow : ExcelColumnRowBase
    Public NotInheritable Class ExcelRow
        Inherits ExcelColumnRowBase
    Inheritance:
    System.Object
    ExcelColumnRowBase
    ExcelRow

    Properties

    AllocatedCells

    Gets only currently allocated cells for this row.

    • C#
    • VB.NET
    public ExcelCellCollection AllocatedCells { get; }
    Public ReadOnly Property AllocatedCells As ExcelCellCollection
    Property Value
    ExcelCellCollection
    Remarks

    Use this collection if you are reading entire Excel file (you don't know exact position of cells with data). If writing values, using Cells property is recommended.

    This collection contains only allocated cells so it is faster as you avoid checking every single cell in a row. You still need to check if a specific cell contains any value (it can be empty).

    See Also
    Cells
    ExcelCell

    Height

    Gets or sets row height.

    • C#
    • VB.NET
    public int Height { get; set; }
    Public Property Height As Integer
    Property Value
    System.Int32
    Remarks

    Unit is twip (1/20th of a point).

    IsAutoFitted

    Gets a value indicating whether this row height is automatically fitted.

    • C#
    • VB.NET
    public bool IsAutoFitted { get; }
    Public ReadOnly Property IsAutoFitted As Boolean
    Property Value
    System.Boolean

    true if this instance is automatically fitted; otherwise, false.

    Methods

    AutoFit()

    Automatically fits row height to the minimum size required for all lines in the row cells to be visible.

    • C#
    • VB.NET
    public void AutoFit()
    Public Sub AutoFit
    Remarks

    Auto-fit row height is a MS Excel feature and not a file format feature. When rows are auto-fit in MS Excel user interface, MS Excel will calculate current character heights and set row height to the new numeric value.

    This method will set Height to the approximate value (maxLinesCount * 255).

    This method doesn't take into account merged ranges when calculating the height. To take into account also merged ranges, use the AutoFit(Boolean) method.

    AutoFit(Boolean)

    Automatically fits row height to the minimum size required for all lines in the row cells to be visible.

    • C#
    • VB.NET
    public void AutoFit(bool autoFitMergedRanges)
    Public Sub AutoFit(autoFitMergedRanges As Boolean)
    Parameters
    autoFitMergedRanges
    System.Boolean

    True if merged ranges should be taken into account.

    Remarks

    Auto-fit row height is a MS Excel feature and not a file format feature. When rows are auto-fit in MS Excel user interface, MS Excel will calculate current character heights and set row height to the new numeric value.

    This method will set Height to the approximate value (maxLinesCount * 255).

    GetHeight(LengthUnit)

    Gets the height of row in arbitrary length unit.

    • C#
    • VB.NET
    public double GetHeight(LengthUnit lengthUnit)
    Public Function GetHeight(lengthUnit As LengthUnit) As Double
    Parameters
    lengthUnit
    LengthUnit

    The length unit in which to return row height.

    Returns
    System.Double

    The height of row in arbitrary length unit.

    SetHeight(Double, LengthUnit)

    Sets the height of row in arbitrary length unit.

    • C#
    • VB.NET
    public void SetHeight(double value, LengthUnit lengthUnit)
    Public Sub SetHeight(value As Double, lengthUnit As LengthUnit)
    Parameters
    value
    System.Double

    Row height value.

    lengthUnit
    LengthUnit

    The length unit in which value is specified.

    Inherited Properties

    Cells

    Gets cell range with column / row cells.

    (Inherited from ExcelColumnRowBase)

    Collapsed

    Gets or sets whether object is collapsed in outlining.

    (Inherited from ExcelColumnRowBase)

    Hidden

    Gets or sets whether excel object is hidden.

    (Inherited from ExcelColumnRowBase)

    Index

    Gets the row / column zero-based index which represents its position in a worksheet.

    (Inherited from ExcelColumnRowBase)

    Name

    Gets the name of ExcelColumnRowBase instance.

    (Inherited from ExcelColumnRowBase)

    OutlineLevel

    Gets or sets outline level.

    (Inherited from ExcelColumnRowBase)

    Style

    Gets or sets the cell formatting of cells in this column / row.

    (Inherited from ExcelColumnRowBase)

    Inherited Methods

    Equals(System.Object)

    Determines whether the specified System.Object is equal to this ExcelColumnRowBase instance.

    (Inherited from ExcelColumnRowBase)

    GetHashCode()

    Returns a hash code for this ExcelColumnRowBase instance.

    (Inherited from ExcelColumnRowBase)

    ToString()

    Returns a System.String that represents this ExcelColumnRowBase instance.

    (Inherited from ExcelColumnRowBase)

    Examples

    Referencing ExcelCell and CellRange in C# and VB.NET

    See Also

    ExcelColumn
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.