-
Notifications
You must be signed in to change notification settings - Fork 297
Freeze and Split Panes
In Excel you can Freeze or Split the worksheet in separate panes to either freeze columns or rows or divide the worksheet into different view.
To freeze a row/column to fix the the headings you use the worksheet.View.FreezePanes method.
This sample is taken from Sample 20 :
//Headers
ws.Cells["B1"].Value = "Name";
ws.Cells["C1"].Value = "Size";
ws.Cells["D1"].Value = "Created";
ws.Cells["E1"].Value = "Last modified";
ws.Cells["B1:E1"].Style.Font.Bold = true;
ws.View.FreezePanes(2, 1);This example will freeze the panes above and to the left of cell A2 in the worksheet, in this case freezing row one.
##Split Panes
You can also split the spreadsheet window in two or four panes that are scrollable and resizable.
EPPlus can to this by using the worksheet.View.SplitPanes or worksheet.View.SplitPanesPixel methods.
The SplitPanes method will split the window using a row/column input. The SplitPanesPixel method will split the panes using a coordinate in pixels.
This sample will split the windows in two panes before row 4.
ws.View.SplitPanes(4, 1);This sample will split the windows in for panes before row 6 and column 6.
ws.View.SplitPanes(6, 6);EPPlus Software AB - https://epplussoftware.com
- What is new in EPPlus 5+
- Breaking Changes in EPPlus 5
- Breaking Changes in EPPlus 6
- Breaking Changes in EPPlus 7
- Breaking Changes in EPPlus 8
- Addressing a worksheet
- Dimension/Used range
- Copying ranges/sheets
- Insert/Delete
- Filling ranges
- Sorting ranges
- Taking and skipping columns/rows
- Data validation
- Comments
- Freeze and Split Panes
- Header and Footer
- Hyperlinks
- Autofit columns
- Grouping and Ungrouping Rows and Columns
- Formatting and styling
- The ExcelRange.Text property
- Conditional formatting
- Using Themes
- Working with custom named table- or slicer- styles