Class ExcelWorksheetView
Represents the different view states of the worksheet
Inherited Members
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
Syntax
public class ExcelWorksheetView : XmlHelper
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
Declaration
public string ActiveCell { get; set; }
Property Value
Type | Description |
---|---|
System.String |
BottomLeftPane
The bottom left pane. This property returns null if the pane does not exist in the Panes array.
Declaration
public ExcelWorksheetView.ExcelWorksheetPanes BottomLeftPane { get; }
Property Value
Type | Description |
---|---|
ExcelWorksheetView.ExcelWorksheetPanes |
BottomRightPane
The bottom right pane. This property returns null if the pane does not exist in the Panes array.
Declaration
public ExcelWorksheetView.ExcelWorksheetPanes BottomRightPane { get; }
Property Value
Type | Description |
---|---|
ExcelWorksheetView.ExcelWorksheetPanes |
PageBreakView
Sets the view mode of the worksheet to pagebreak
Declaration
public bool PageBreakView { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
PageLayoutView
Sets the view mode of the worksheet to pagelayout
Declaration
public bool PageLayoutView { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Panes
Reference to the panes
Declaration
public ExcelWorksheetView.ExcelWorksheetPanes[] Panes { get; }
Property Value
Type | Description |
---|---|
ExcelWorksheetView.ExcelWorksheetPanes[] |
PaneSettings
Contains settings for the active pane
Declaration
public ExcelWorksheetView.ExcelWorksheetViewPaneSettings PaneSettings { get; }
Property Value
Type | Description |
---|---|
ExcelWorksheetView.ExcelWorksheetViewPaneSettings |
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'.
Declaration
public bool RightToLeft { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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).
Declaration
public string SelectedRange { get; set; }
Property Value
Type | Description |
---|---|
System.String |
SheetViewElement
Returns a reference to the sheetView element
Declaration
protected XmlElement SheetViewElement { get; }
Property Value
Type | Description |
---|---|
System.Xml.XmlElement |
ShowGridLines
Show gridlines in the worksheet
Declaration
public bool ShowGridLines { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ShowHeaders
Show the Column/Row headers (containg column letters and row numbers)
Declaration
public bool ShowHeaders { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
TabSelected
If the worksheet is selected within the workbook. NOTE: Setter clears other selected tabs.
Declaration
public bool TabSelected { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
TabSelectedMulti
If the worksheet is selected within the workbook. NOTE: Setter keeps other selected tabs.
Declaration
public bool TabSelectedMulti { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
TopLeftCell
The Top-Left Cell visible. Single cell address. Empty string or null is the same as A1.
Declaration
public string TopLeftCell { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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.
Declaration
public ExcelWorksheetView.ExcelWorksheetPanes TopLeftPane { get; }
Property Value
Type | Description |
---|---|
ExcelWorksheetView.ExcelWorksheetPanes |
TopRightPane
The top right pane. This property returns null if the pane does not exist in the Panes array.
Declaration
public ExcelWorksheetView.ExcelWorksheetPanes TopRightPane { get; }
Property Value
Type | Description |
---|---|
ExcelWorksheetView.ExcelWorksheetPanes |
ZoomScale
Window zoom magnification for current view representing percent values.
Declaration
public int ZoomScale { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
FreezePanes(Int32, Int32)
Freeze the columns/rows to left and above the cell
Declaration
public void FreezePanes(int Row, int Column)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | Row | |
System.Int32 | Column |
SetTabSelected(Boolean, Boolean)
Sets whether the worksheet is selected within the workbook.
Declaration
public void SetTabSelected(bool isSelected = true, bool allowMultiple = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isSelected | Whether the tab is selected, defaults to true. |
System.Boolean | allowMultiple | Whether to allow multiple active tabs, defaults to false. |
SplitPanes(Int32, Int32)
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()
Declaration
public void SplitPanes(int rowsTop, int columnsLeft)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowsTop | Splits the panes at the coordinate after this visible row. Zero mean no split on row level |
System.Int32 | columnsLeft | Splits the panes at the coordinate after this visible column. Zero means no split on column level. |
SplitPanesPixels(Int32, Int32)
Split panes at the position in pixels from the top-left corner.
Declaration
public void SplitPanesPixels(int pixelsY, int pixelsX)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pixelsY | Vertical pixels |
System.Int32 | pixelsX | Horizontal pixels |
UnFreezePanes()
Unlock all rows and columns to scroll freely
Declaration
public void UnFreezePanes()