Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / SheetView Class / SplitColumns Property
Example


In This Topic
    SplitColumns Property
    In This Topic
    Gets or sets the number of Columns after which a vertical split will appear in the Worksheet.   
    Syntax
    'Declaration
     
    
    Public Property SplitColumns As Integer
    'Usage
     
    
    Dim instance As SheetView
    Dim value As Integer
     
    instance.SplitColumns = value
     
    value = instance.SplitColumns
    public int SplitColumns {get; set;}
    Remarks

    Creating a split will divide the SheetView in two; afterwards, both sides of the split can be scrolled independently.

    The value must be between 0 and 16384; a value of 2, for example, would create a split at the right of the second Column.

    The default value is 0, which doesn't create a split.

    Note that if the value of FrozenColumns is greater than 0, this property will have no effect.

    Example
    Splits the worksheet horizontally after the 5th row and vertically after the first column:
    
    using( var workbook = Workbook.Load( "test.xlsx" ) )
    {
      // Splits horizontally after the first 5 rows and adds a Fill Background to them.
      worksheet.SheetView.SplitRows = 5;
      worksheet.Rows[ 0, 4 ].Style.Fill.BackgroundColor = System.Drawing.Color.Turquoise;
    
      // Splits vertically after the 1st column and adds a Fill Background to the first column.
      worksheet.SheetView.SplitColumns = 1;
      worksheet.Columns[ 0 ].Style.Fill.BackgroundColor = System.Drawing.Color.Tan;
    
      // Saves the workbook to disk.
      workbook.SaveAs( "SplitRowsColumns.xlsx" );
    }
    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