Click or drag to resize
VerticalPageBreakCollection Class
Collection of vertical page breaks (VerticalPageBreak).
Inheritance Hierarchy
SystemObject
  GemBox.SpreadsheetPageBreakCollection
    GemBox.SpreadsheetPageBreakCollectionVerticalPageBreak
      GemBox.SpreadsheetVerticalPageBreakCollection

Namespace:  GemBox.Spreadsheet
Assembly:  GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1032
Syntax
public sealed class VerticalPageBreakCollection : PageBreakCollection<VerticalPageBreak>

The VerticalPageBreakCollection type exposes the following members.

Properties
  NameDescription
Public propertyCount
Gets the number of page breaks contained in the collection.
(Inherited from PageBreakCollection.)
Public propertyItem
Gets or sets the vertical page break at the specified index.
Top
Methods
  NameDescription
Public methodAdd(Int32)
Ads a new vertical page break left to the specified column.
Public methodAdd(Int32, Int32, Int32)
Ads a new vertical page break left to the specified column and within specified rows.
Public methodClear
Removes all page breaks.
(Inherited from PageBreakCollection.)
Public methodGetEnumerator
Returns an enumerator for the collection.
(Inherited from PageBreakCollectionT.)
Public methodRemoveAt
Removes the page break at the specified index.
(Inherited from PageBreakCollection.)
Top
Examples

Following code demonstrates how to add PageBreaks to ExcelWorksheet.

int columnsPerPage = 6, rowsPerPage = 30;

int usedColumnsCount = ws.CalculateMaxUsedColumns();
for (int i = columnsPerPage; i < usedColumnsCount; i += columnsPerPage)
    ws.VerticalPageBreaks.Add(i);

for (int i = rowsPerPage; i < ws.Rows.Count; i += rowsPerPage)
    ws.HorizontalPageBreaks.Add(i);
See Also