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

    Show / Hide Table of Contents

    ExcelColumnRowBase Class

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

    Base class for the excel column and row classes.

    • C#
    • VB.NET
    public abstract class ExcelColumnRowBase
    Public MustInherit Class ExcelColumnRowBase
    Inheritance:
    System.Object
    ExcelColumnRowBase
    Derived
    ExcelColumn
    ExcelRow

    Properties

    Cells

    Gets cell range with column / row cells.

    • C#
    • VB.NET
    public CellRange Cells { get; }
    Public ReadOnly Property Cells As CellRange
    Property Value
    CellRange
    See Also
    AllocatedCells
    ExcelCell

    Collapsed

    Gets or sets whether object is collapsed in outlining.

    • C#
    • VB.NET
    public bool Collapsed { get; set; }
    Public Property Collapsed As Boolean
    Property Value
    System.Boolean
    Remarks

    When you use outline grouping and you want outline group to be collapsed, you need to set three properties:

    OutlineLevel property needs to be set to correct outline level.

    If group is collapsed, for all rows in the collapsed group Hidden property needs to be set to true.

    If group is collapsed, for the row where collapsed (plus) sign is located Collapsed property needs to be set to true.

    This value is currently ignored when exporting a document to PDF, XPS, or image file formats.

    See Also
    OutlineLevel

    Hidden

    Gets or sets whether excel object is hidden.

    • C#
    • VB.NET
    public bool Hidden { get; set; }
    Public Property Hidden As Boolean
    Property Value
    System.Boolean
    Remarks

    When you use outline grouping and you want outline group to be collapsed, you need to set three properties:

    OutlineLevel property needs to be set to correct outline level.

    If group is collapsed, for all rows in the collapsed group Hidden property needs to be set to true.

    If group is collapsed, for the row where collapsed (plus) sign is located Collapsed property needs to be set to true.

    Index

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

    • C#
    • VB.NET
    public int Index { get; }
    Public ReadOnly Property Index As Integer
    Property Value
    System.Int32

    Name

    Gets the name of ExcelColumnRowBase instance.

    • C#
    • VB.NET
    public string Name { get; }
    Public ReadOnly Property Name As String
    Property Value
    System.String
    Remarks

    A row name includes row number. For example, the name of row 0 is "1". A column name includes column letter. For example, the name of column 0 is "A".

    OutlineLevel

    Gets or sets outline level.

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

    Exception is thrown if value is out of 0 to 7 range.

    Using this property you can create hierarchical groups. Range of consecutive objects (rows or columns) with the same value of outline level belongs to the same group. Default value is zero, which prevents grouping.

    When you use outline grouping and you want outline group to be collapsed, you need to set three properties:

    OutlineLevel property needs to be set to correct outline level.

    If group is collapsed, for all rows in the collapsed group Hidden property needs to be set to true.

    If group is collapsed, for the row where collapsed (plus) sign is located Collapsed property needs to be set to true.

    This value is currently ignored when exporting a document to PDF, XPS, or image file formats.

    Exceptions
    System.ArgumentOutOfRangeException

    Value is out of 0 to 7 range.

    See Also
    Collapsed

    Style

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

    • C#
    • VB.NET
    public CellStyle Style { get; set; }
    Public Property Style As CellStyle
    Property Value
    CellStyle

    The cell formatting of cells in this column / row.

    Remarks

    Conceptually, cell formatting is divided into following groups:

    • Number - indicates how to format and render the numeric value of a cell. Associated property is NumberFormat.
    • Alignment - formatting information pertaining to text alignment in cells. Associated properties are HorizontalAlignment, VerticalAlignment, Indent, Rotation, IsTextVertical, WrapText and ShrinkToFit.
    • Font - defines the properties for the used font. Associated property is Font.
    • Border - expresses a single set of cell border formats (left, right, top, bottom and diagonal). Associated property is Borders.
    • Fill - specifies fill formatting (pattern or gradient). Associated property is FillPattern.
    • Protection - contains protection properties associated with the cell. Associated properties are Locked and FormulaHidden.

    Additional CellStyle properties not associated with any formatting group are:

    • Name - name of the referenced Style.
    • QuotePrefix - true to store numeric value of a cell as text; otherwise, false.
    • IsDefault - true if Name Style is default (Normal) and there are no additional modifications of cell formatting; otherwise, false.

    ExcelFile contains a set of Styles which can be referenced by multiple cells.

    ExcelFile must always contain at least one Style which cannot be removed and is, by default, referenced by all cells. This default style is Normal.

    Style can either be built-in or user-defined. Built-in style is accessible from Styles via BuiltInCellStyleName enumeration.

    Cell formatting group (Number, Alignment, Font, Border, Fill or Protection) (and its associated properties) is resolved from Name Style, unless cell formatting group or its associated property is modified.

    Cell formatting is available for one or more cells through Style property which is available on ExcelCell and CellRange types. Cell formatting specified on ExcelColumn and ExcelRow types through Style property is simply propagated to cell formatting of its Cells.

    note

    For performance reasons, cell formatting on CellRange is resolved based just on its top-left cell formatting, except borders which are resolved based on corner cells depending on border side.

    Setting cell formatting property on CellRange is propagated to each cell in a range.

    To set Style to one or more cells, simply assign it to Style property.

    tip

    Preferable way to modify formatting property of multiple cells is to get CellRange to which all those cells belong, and use Style property of that range to make the modification.

    If modifying multiple formatting properties of a CellRange, without preserving unmodified formatting properties, preferable way is to create new instance of CellStyle, make modifications on it, and assign it to Style property of that range.

    GemBox.Spreadsheet internally takes care not to allocate unnecessary cells when formatting a range of cells (for example, when formatting Cells) and to cache formatting information of equally formatted cells, at the appropriate time, to reduce memory footprint.

    Methods

    Equals(Object)

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

    • C#
    • VB.NET
    public override bool Equals(object obj)
    Public Overrides Function Equals(obj As Object) As Boolean
    Parameters
    obj
    System.Object

    The System.Object to compare with this ExcelColumnRowBase instance.

    Returns
    System.Boolean

    true if the specified System.Object is a ExcelColumnRowBase and is equal to this ExcelColumnRowBase instance; otherwise, false.

    Overrides
    System.Object.Equals(System.Object)

    GetHashCode()

    Returns a hash code for this ExcelColumnRowBase instance.

    • C#
    • VB.NET
    public override int GetHashCode()
    Public Overrides Function GetHashCode As Integer
    Returns
    System.Int32

    An integer value that specifies a hash value for this ExcelColumnRowBase instance.

    Overrides
    System.Object.GetHashCode()

    ToString()

    Returns a System.String that represents this ExcelColumnRowBase instance.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this ExcelColumnRowBase instance.

    Overrides
    System.Object.ToString()
    Remarks

    This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).

    Operators

    Equality(ExcelColumnRowBase, ExcelColumnRowBase)

    Determines whether first and second ExcelColumnRowBases are equal.

    • C#
    • VB.NET
    public static bool operator ==(ExcelColumnRowBase first, ExcelColumnRowBase second)
    Public Shared Operator =(first As ExcelColumnRowBase, second As ExcelColumnRowBase) As Boolean
    Parameters
    first
    ExcelColumnRowBase

    The first ExcelColumnRowBase.

    second
    ExcelColumnRowBase

    The second ExcelColumnRowBase.

    Returns
    System.Boolean

    true if first and second ExcelColumnRowBases are equal; otherwise, false.

    Inequality(ExcelColumnRowBase, ExcelColumnRowBase)

    Determines whether first and second ExcelColumnRowBases are not equal.

    • C#
    • VB.NET
    public static bool operator !=(ExcelColumnRowBase first, ExcelColumnRowBase second)
    Public Shared Operator <>(first As ExcelColumnRowBase, second As ExcelColumnRowBase) As Boolean
    Parameters
    first
    ExcelColumnRowBase

    The first ExcelColumnRowBase.

    second
    ExcelColumnRowBase

    The second ExcelColumnRowBase.

    Returns
    System.Boolean

    true if first and second ExcelColumnRowBases are not equal; otherwise, false.

    Examples

    Referencing ExcelCell and CellRange in C# and VB.NET
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.