[]
        
(Showing Draft Content)

Setting Fixed (Frozen) Rows or Columns

You can freeze rows or columns or both in a sheet to make them unscrollable.

!type=note

Note: Frozen rows or columns are not scrollable at run time but they are scrollable during design time.

Set Frozen Rows or Columns

The frozen top rows are called leading rows and the frozen left-most columns are called leading columns. The frozen leading rows and columns stay at the top and left of the view regardless of the scrolling.

You can set the number of frozen rows or columns by using the FrozenRowCount or FrozenColumnCount properties.


// freeze rows and columns
FpSpread1.Sheets[0].FrozenColumnCount = 2;
FpSpread1.Sheets[0].FrozenRowCount = 2;
'freeze rows And columns
FpSpread1.Sheets(0).FrozenColumnCount = 2
FpSpread1.Sheets(0).FrozenRowCount = 2

Set Trailing Frozen Rows or Columns

The frozen trailing rows and columns stay at the bottom and right of the view regardless of the scrolling.

You can set the number of frozen trailing bottom rows or trailing right-most columns by using FrozenTrailingColumnCount or FrozenTrailingRowCount properties.


When the height of data rows and frozen trailing rows is less than that of the viewport area, you can choose whether to display the blank space between the data rows and frozen trailing rows or not. The FrozenTrailingStickToEdge option can be used to control this behavior and accepts RowCol enumeration values such as Both (default), Rows, Columns, None.

When FrozenTrailingStickToEdge = Row

When FrozenTrailingStickToEdge = None

Frozen Trailing Rows with stickToEdge Parameter set To True

Frozen Trailing Rows with stickToEdge Parameter set To False


fpSpread1.ActiveSheet.Rows.Count = 25;
fpSpread1.ActiveSheet.Columns.Count = 20;
fpSpread1.Sheets[0].FrozenTrailingRowCount = 5;
fpSpread1.ActiveSheet.FrozenTrailingStickToEdge = FarPoint.Win.Spread.RowCol.Rows;
FpSpread1.ActiveSheet.Rows.Count = 25
FpSpread1.ActiveSheet.Columns.Count = 20
FpSpread1.Sheets(0).FrozenTrailingRowCount = 5
FpSpread1.ActiveSheet.FrozenTrailingStickToEdge = FarPoint.Win.Spread.RowCol.Rows

!type=note

Note:

When using the print option, trailing frozen rows and columns are not printed repeatedly at the bottom and right of every page, but print only once as the last row and column.

Leading frozen rows and columns can be repeatedly printed at the top and left of every page. For more information about repeating rows and columns, refer to Repeating Rows or Columns on Printed Pages.

Set Frozen Line Color

You can specify the color of the line displayed between the frozen and non-frozen areas of the worksheet with the FrozenLineColor property in the WorksheetOptions class. By default, no color is set to show the frozen line.

The preferred frozen line color can be chosen by using Color methods.


// freeze rows and columns
fpSpread1.Sheets[0].FrozenColumnCount = 2;
fpSpread1.Sheets[0].FrozenRowCount = 2;
fpSpread1.Sheets[0].FrozenTrailingColumnCount = 2;
fpSpread1.Sheets[0].FrozenTrailingRowCount = 2;
// set frozen line color
fpSpread1.AsWorkbook().Worksheets[0].Options.FrozenLineColor = GrapeCity.Spreadsheet.Color.FromArgb(0, 0, 255);
'freeze rows And columns
FpSpread1.Sheets(0).FrozenColumnCount = 2
FpSpread1.Sheets(0).FrozenRowCount = 2
FpSpread1.Sheets(0).FrozenTrailingColumnCount = 2
FpSpread1.Sheets(0).FrozenTrailingRowCount = 2
'set frozen line color
FpSpread1.AsWorkbook().Worksheets(0).Options.FrozenLineColor = GrapeCity.Spreadsheet.Color.FromArgb(0, 0, 255)

Set Frozen Line Width

You can specify or change the width of the displayed line between the frozen and non-frozen areas of the worksheet using FrozenLineThickness property from the WorksheetOptions class.


fpSpread1.ActiveSheet.FrozenColumnCount = 3;
fpSpread1.ActiveSheet.AsWorksheet().Options.FrozenLineThickness = 5;
fpSpread1.ActiveSheet.FrozenColumnCount = 3
fpSpread1.ActiveSheet.AsWorksheet().Options.FrozenLineThickness = 5

Using the Properties Window

  1. At design time, in the Properties window, select the Sheet.

  2. In the SheetView Collection Editor (Appearance section), set the FrozenRowCount, FrozenColumnCount, FrozenTrailingRowCount, FrozenTrailingColumnCount, or the FrozenTrailingStickToEdge property.

Using the Spread Designer

  1. Select Sheet from the drop-down combo list located on the top right side of the Designer.

  2. From the SheetView Collection Editor,set the FrozenColumnCount, FrozenRowCount, FrozenTrailingColumnCount, FrozenTrailingRowCount, FrozenTrailingStickToEdge.

  3. From the File menu, select Save and Exit to save the changes.

See Also

Rows and Columns

Customizing the Number of Rows or Columns

Adding a Row or Column

Removing a Row or Column

Showing or Hiding a Row or Column

Setting the Row Height or Column Width

Moving Rows or Columns

Creating Alternating Rows

Setting up Preview Rows

Input Data in Rows or Columns

Rows or Columns That Have Data

Adding a Tag to a Row or Column

Rows and Columns

Customizing the Number of Rows or Columns

Adding a Row or Column

Removing a Row or Column

Showing or Hiding a Row or Column

Setting the Row Height or Column Width

Moving Rows or Columns

Creating Alternating Rows

Setting up Preview Rows

Input Data in Rows or Columns

Rows or Columns That Have Data

Adding a Tag to a Row or Column