Class ExcelWorksheetView
- Namespace
- OfficeOpenXml
- Assembly
- EPPlus.dll
Represents the different view states of the worksheet
public class ExcelWorksheetView : XmlHelper
- Inheritance
-
ExcelWorksheetView
- Inherited Members
Properties
ActiveCell
The active cell. Single cell address.
This cell must be inside the selected range. If not, the selected range is set to the active cell address
public string ActiveCell { get; set; }
Property Value
BottomLeftPane
The bottom left pane. This property returns null if the pane does not exist in the Panes array.
public ExcelWorksheetView.ExcelWorksheetPanes BottomLeftPane { get; }
Property Value
BottomRightPane
The bottom right pane. This property returns null if the pane does not exist in the Panes array.
public ExcelWorksheetView.ExcelWorksheetPanes BottomRightPane { get; }
Property Value
PageBreakView
Sets the view mode of the worksheet to pagebreak
public bool PageBreakView { get; set; }
Property Value
PageLayoutView
Sets the view mode of the worksheet to pagelayout
public bool PageLayoutView { get; set; }
Property Value
PaneSettings
Contains settings for the active pane
public ExcelWorksheetView.ExcelWorksheetViewPaneSettings PaneSettings { get; }
Property Value
Panes
Reference to the panes
public ExcelWorksheetView.ExcelWorksheetPanes[] Panes { get; }
Property Value
RightToLeft
If the sheet is in 'right to left' display mode. Column A is on the far right and column B to the left of A. Text is also 'right to left'.
public bool RightToLeft { get; set; }
Property Value
SelectedRange
Selected Cells in the worksheet. Used in combination with ActiveCell. If the active cell is not inside the selected range, the active cell will be set to the first cell in the selected range. If the selected range has multiple adresses, these are separated with space. If the active cell is not within the first address in this list, the attribute ActiveCellId must be set (not supported, so it must be set via the XML).
public string SelectedRange { get; set; }
Property Value
SheetViewElement
Returns a reference to the sheetView element
protected XmlElement SheetViewElement { get; }
Property Value
- XmlElement
ShowGridLines
Show gridlines in the worksheet
public bool ShowGridLines { get; set; }
Property Value
ShowHeaders
Show the Column/Row headers (containg column letters and row numbers)
public bool ShowHeaders { get; set; }
Property Value
TabSelected
If the worksheet is selected within the workbook. NOTE: Setter clears other selected tabs.
public bool TabSelected { get; set; }
Property Value
TabSelectedMulti
If the worksheet is selected within the workbook. NOTE: Setter keeps other selected tabs.
public bool TabSelectedMulti { get; set; }
Property Value
TopLeftCell
The Top-Left Cell visible. Single cell address. Empty string or null is the same as A1.
public string TopLeftCell { get; set; }
Property Value
TopLeftPane
The top left pane or the top pane if the sheet is horizontaly split. This property returns null if the pane does not exist in the Panes array.
public ExcelWorksheetView.ExcelWorksheetPanes TopLeftPane { get; }
Property Value
TopRightPane
The top right pane. This property returns null if the pane does not exist in the Panes array.
public ExcelWorksheetView.ExcelWorksheetPanes TopRightPane { get; }
Property Value
ZoomScale
Window zoom magnification for current view representing percent values.
public int ZoomScale { get; set; }
Property Value
Methods
FreezePanes(int, int)
Freeze the columns and rows starting from TopLeftCell
public void FreezePanes(int Row, int Column)
Parameters
Row
intRows from the TopLeftCell. Starts from 1
Column
intColumns from the TopLeftCell. Starts from 1
SetTabSelected(bool, bool)
Sets whether the worksheet is selected within the workbook.
public void SetTabSelected(bool isSelected = true, bool allowMultiple = false)
Parameters
isSelected
boolWhether the tab is selected, defaults to true.
allowMultiple
boolWhether to allow multiple active tabs, defaults to false.
SplitPanes(int, int)
Split the window at the supplied row/column. The split is performed using the current width/height of the visible rows and columns, so any changes to column width or row heights after the split will not effect the split position. To remove split call this method with zero as value of both paramerters or use UnFreezePanes()
public void SplitPanes(int rowsTop, int columnsLeft)
Parameters
rowsTop
intSplits the panes at the coordinate after this visible row. Zero mean no split on row level
columnsLeft
intSplits the panes at the coordinate after this visible column. Zero means no split on column level.
SplitPanesPixels(int, int)
Split panes at the position in pixels from the top-left corner.
public void SplitPanesPixels(int pixelsY, int pixelsX)
Parameters
UnFreezePanes()
Unlock all rows and columns to scroll freely
public void UnFreezePanes()