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


In This Topic
    TableColumnCollection Class
    In This Topic
    Represents a collection of TableColumns in a Table.   
    Object Model
    TableColumnCollection ClassTableColumn Class
    Syntax
    'Declaration
     
    
    <DefaultMemberAttribute("Item")>
    Public Class TableColumnCollection 
       Inherits WorksheetElement
    'Usage
     
    
    Dim instance As TableColumnCollection
    [DefaultMember("Item")]
    public class TableColumnCollection : WorksheetElement 
    Example
    using( var doc = Workbook.Create( "test.xlsx") )   // Creates a Workbook named “test.xlsx”.
      {
        var worksheetA = workbook.Worksheets[ 0 ];
    
        // Fill cells values.
        worksheetA.Rows[ 4 ].Cells[ 6 ].Value = "Fruits";
        worksheetA.Rows[ 5 ].Cells[ 6 ].Value = "Strawberry";
        worksheetA.Rows[ 6 ].Cells[ 6 ].Value = "Orange";
        worksheetA.Rows[ 7 ].Cells[ 6 ].Value = "Banana";
        worksheetA.Rows[ 8 ].Cells[ 6 ].Value = "Apple";
        worksheetA.Rows[ 4 ].Cells[ 7 ].Value = "Quantity";
        worksheetA.Rows[ 5 ].Cells[ 7 ].Value = 8;
        worksheetA.Rows[ 6 ].Cells[ 7 ].Value = 2;
        worksheetA.Rows[ 7 ].Cells[ 7 ].Value = 3;
        worksheetA.Rows[ 8 ].Cells[ 7 ].Value = 3;
    
        // Creates the formatted table from cell (4,6) to cell (8,7), using a medium theme, with the formatted header row displayed.
        worksheetA.Tables.Add( 4, 6, 8, 7, TableStyle.TableStyleMedium20, true );
    
        // Gets the first table of the Worksheet.
        var firstTable = worksheetA.Tables[ “Table1” ];
    
        // Sets a TotalRowLabel on the first column of the Table. 
        firstTable.Columns[ 0 ].TotalRowLabel = "TOTAL:";
    
        doc.Save();
      }
    Inheritance Hierarchy

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

    Public Properties
     NameDescription
    Public PropertyGets the number of TableColumns in the TableColumnCollection.  
    Public PropertyOverloaded. Gets a TableColumn from the TableColumnCollection.  
    Top
    Public Methods
     NameDescription
    Public Method  
    Top
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also