Frozen Columns are always shown at the left of the SheetView when a user scrolls to the right.
The default value is 0, which unfreezes all Columns. However, the value can be a number between 0 and 16384. A value of 16384 would freeze all Columns in the Worksheet; if a value of 3 was to be used, the first three Columns of the Worksheet would be frozen & would always be seen at the left of the SheetView, no matter how far the user scrolls to the right.
Note that the freeze will always start with the first Column in the Worksheet.
Freezes the first five rows and the first column: using( var workbook = Workbook.Load( "test.xlsx" ) ) { // Freezes the first 5 rows and adds a Fill Background to them. worksheet.SheetView.FrozenRows = 5; worksheet.Rows[ 0, 4 ].Style.Fill.BackgroundColor = System.Drawing.Color.Turquoise; // Freezes the first column and adds a Fill Background to it. worksheet.SheetView.FrozenColumns = 1; worksheet.Columns[ 0 ].Style.Fill.BackgroundColor = System.Drawing.Color.Tan; // Saves the workbook to disk. workbook.SaveAs( "FreezeRowsColumns.xlsx" ); }
.NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.
.NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.