You can freeze (make unscrollable) a number of either rows or columns or both in a sheet. You can freeze any number of top rows, called leading rows or any number of left-most columns, called leading columns. You can also freeze any number of the trailing bottom rows or trailing right-most columns. The frozen leading rows and columns stay at the top and left of the view regardless of the scrolling. The frozen trailing rows and columns stay at the bottom and right of the view regardless of the scrolling.
The figure below displays one frozen trailing row and column that stay in view:
Properties involved with frozen rows and columns are:
Frozen rows or columns are nonscrollable at run time, but during design time, they are still scrollable.
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 repeated. For more information about repeating rows and columns, refer to
The leading frozen row or column is a separate viewport while the trailing frozen row or column is also a separate viewport. Indexes for the frozen viewports are:
For more information about viewports, refer to Customizing Viewports.
In hierarchical displays, frozen leading rows and columns are possible in child sheets.
Return to Allowing User Interaction with Rows and Columns.
Using the Properties Window
- At design time, in the Properties window, select the Sheet.
- In the SheetView Collection Editor (Appearance section), select the FrozenRowCount, FrozenColumnCount, FrozenTrailingRowCount, or the FrozenTrailingColumnCount property.
- Type a value. (The default is 0.) Repeat this for each property.
Using Code
Set the FrozenRowCount, FrozenColumnCount, FrozenTrailingColumnCount, or the FrozenTrailingRowCount property for the sheet.
Example
C# | Copy Code |
---|---|
fpSpread1.Sheets[0].FrozenColumnCount = 2; fpSpread1.Sheets[0].FrozenRowCount = 2; fpSpread1.Sheets[0].FrozenTrailingColumnCount = 2; fpSpread1.Sheets[0].FrozenTrailingRowCount = 2; |
VB | Copy Code |
---|---|
FpSpread1.Sheets(0).FrozenColumnCount = 2 FpSpread1.Sheets(0).FrozenRowCount = 2 FpSpread1.Sheets(0).FrozenTrailingColumnCount = 2 FpSpread1.Sheets(0).FrozenTrailingRowCount = 2 |
Using the Spread Designer
- Select Sheet from the drop-down combo list located on the top right side of the Designer.
- From the SheetView Collection Editor, type a number for FrozenColumnCount, FrozenRowCount, FrozenTrailingColumnCount, or FrozenTrailingRowCount.
- From the File menu, select Save and Exit to save the changes.