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


In This Topic
    Column Class
    In This Topic
    Represents a column in a Worksheet.
    Syntax
    'Declaration
     
    
    Public Class Column 
       Inherits LinearWorksheetElement
    'Usage
     
    
    Dim instance As Column
    public class Column : LinearWorksheetElement 
    Remarks
    Derives from LinearWorksheetElement.
    Example
    using( var doc = Workbook.Load( "test.xlsx") )
      {
        var worksheet = doc.Worksheets[ 0 ];        
        worksheet.Columns[ 1 ].Cells[ 1 ].Value =  new DateTime( 2021, 7, 1, 10, 22, 33 );   // Sets “B2”.
        worksheet.Columns[ 2 ].Width = 65d;
        doc.Save();
      }
    Inheritance Hierarchy

    System.Object
       Xceed.Workbooks.NET.WorkbookElement
          Xceed.Workbooks.NET.WorksheetElement
             Xceed.Workbooks.NET.StyledWorksheetElement
                Xceed.Workbooks.NET.LinearWorksheetElement
                   Xceed.Workbooks.NET.Column

    Public Properties
     NameDescription
    Public PropertyGets or sets if the Column's Width will be adjusted to fit the Cells' largest content.  
    Public PropertyGets the ColumnCellCollection.  
    Public PropertySets the Column's DataValidation.  
    Public PropertyGets the Id of a specific column in a worksheet. The first column starts at Id 0 and last column is located at Id 16383. (Inherited from Xceed.Workbooks.NET.LinearWorksheetElement)
    Public PropertyGets the index of the Column and returns it as a letter.  
    Public PropertyGets or sets if the Row or Column is hidden or not. (Inherited from Xceed.Workbooks.NET.LinearWorksheetElement)
    Public PropertyGets the Style used by the Worksheet element. (Inherited from Xceed.Workbooks.NET.StyledWorksheetElement)
    Public PropertyGets or sets the Column's width.  
    Top
    Public Methods
     NameDescription
    Public MethodAdds ConditionalFormatting to the Column.  
    Public MethodOverridden. Adjusts the Column's Width based on the Cell with the widest content.  
    Public MethodRemoves specific elements from the LinearWorksheetElement. (Inherited from Xceed.Workbooks.NET.LinearWorksheetElement)
    Public MethodRemoves all ConditionalFormattings from the Column.  
    Public MethodGets the Column's ConditionalFormattings.  
    Public MethodRemoves a specific ConditionalFormatting from the Column.  
    Public MethodSearches into the content of the Column and replaces all occurences of a specific value with a new value. (Inherited from Xceed.Workbooks.NET.LinearWorksheetElement)
    Public MethodSearches into the content of the LinearWorksheetElement and replaces all instances of the searchValues with their corresponding newValues. (Inherited from Xceed.Workbooks.NET.LinearWorksheetElement)
    Top
    Protected Methods
     NameDescription
    Protected Internal MethodOverridden.   
    Protected Internal MethodOverridden.   
    Protected Internal MethodOverridden.   
    Protected Internal Method (Inherited from Xceed.Workbooks.NET.StyledWorksheetElement)
    Protected Internal MethodOverridden.   
    Protected Internal MethodOverridden.   
    Protected Internal MethodOverridden.   
    Protected Internal MethodOverridden.   
    Protected Internal Method (Inherited from Xceed.Workbooks.NET.LinearWorksheetElement)
    Protected Internal MethodOverridden.   
    Protected Internal Method (Inherited from Xceed.Workbooks.NET.LinearWorksheetElement)
    Protected Internal MethodOverridden.   
    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