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


In This Topic
    ColumnCollection Class
    In This Topic
    Represents a collection of Columns in a Worksheet.
    Object Model
    ColumnCollection ClassColumn Class
    Syntax
    'Declaration
     
    
    <DefaultMemberAttribute("Item")>
    Public Class ColumnCollection 
       Inherits WorksheetElement
    'Usage
     
    
    Dim instance As ColumnCollection
    [DefaultMember("Item")]
    public class ColumnCollection : WorksheetElement 
    Example
    using( var doc = Workbook.Load( "test.xlsx") )
      {
        var worksheet = doc.Worksheets[ 0 ];        
        worksheet.Columns[ 1 ].Width = 25d;    // Sets column’s “B” width.
        doc.Save();
      }
    Inheritance Hierarchy

    System.Object
       Xceed.Workbooks.NET.WorkbookElement
          Xceed.Workbooks.NET.WorksheetElement
             Xceed.Workbooks.NET.ColumnCollection

    Public Properties
     NameDescription
    Public PropertyGets the number of Columns in the ColumnCollection.  
    Public PropertyOverloaded. Gets the Column or ColumnRange corresponding to the given Ids or addresses.  
    Top
    Public Methods
     NameDescription
    Public MethodAdjusts the Columns’ Width based on the Cell with the widest content in the ColumnRange.  
    Public Method  
    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