Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / ColumnRange Class
Members Example


In This Topic
    ColumnRange Class
    In This Topic
    Defines a ColumnRange, which is a range of consecutives Columns.
    Syntax
    Remarks
    This class derives from LinearRange.
    Example
    using( var workbook = Workbook.Create( "ColumnRange.xlsx" ) ) 
      { 
        // Gets the first Worksheet; a Workbook always contains at least 1 Worksheet. 
        var worksheet = workbook.Worksheets[ 0 ]; 
    
        // Gets the Columns B, C and D. 
        var columnRange = worksheet.Columns[ "B", "D" ]; 
    
        // Sets the columnRange's Background color to yellow. 
        columnRange.Style.Fill.BackgroundColor = Color.Yellow; 
     
        // Saves Workbook to disk; 
        workbook.Save(); 
      }
    Inheritance Hierarchy

    System.Object
       Xceed.Workbooks.NET.WorkbookElement
          Xceed.Workbooks.NET.WorksheetElement
             Xceed.Workbooks.NET.StyledWorksheetElement
                Xceed.Workbooks.NET.StyledRange<T>
                   Xceed.Workbooks.NET.LinearRange<T>
                      Xceed.Workbooks.NET.ColumnRange

    Public Properties
     NameDescription
    Public PropertyGets the number of columns in the ColumnRange. (Inherited from Xceed.Workbooks.NET.LinearRange<Column>)
    Public PropertyGets the items in the range. (Inherited from Xceed.Workbooks.NET.StyledRange<T>)
    Public PropertyGets or sets the last item in the range. (Inherited from Xceed.Workbooks.NET.StyledRange<T>)
    Public PropertyGets or sets if the Rows in the RowRange or the Columns in the ColumnRange are hidden are not.   (Inherited from Xceed.Workbooks.NET.LinearRange<Column>)
    Public PropertyGets or sets the first item in the range. (Inherited from Xceed.Workbooks.NET.StyledRange<T>)
    Public PropertyGets the Style used by the Worksheet element. (Inherited from Xceed.Workbooks.NET.StyledWorksheetElement)
    Public PropertyGets or sets the Width of all Columns in the range.  
    Top
    Public Methods
     NameDescription
    Public MethodOverridden. Adjusts the Columns’ Width based on the Cell with the widest content in the ColumnRange.  
    Public MethodRemoves specific elements from the LinearRange. (Inherited from Xceed.Workbooks.NET.LinearRange<Column>)
    Public Method (Inherited from Xceed.Workbooks.NET.LinearRange<Column>)
    Public Method (Inherited from Xceed.Workbooks.NET.LinearRange<Column>)
    Public MethodSearches into the content of the LinearRange and replaces all occurences of a specific value with a new value. (Inherited from Xceed.Workbooks.NET.LinearRange<Column>)
    Public MethodSearches into the content of the LinearRange and replaces all instances of the searchValues with their corresponding newValues. (Inherited from Xceed.Workbooks.NET.LinearRange<Column>)
    Public Method (Inherited from Xceed.Workbooks.NET.LinearRange<Column>)
    Top
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also