Skip to main content
Row

Worksheet.FreezeRows(Int32) Method

Freezes the specified number of rows at the top of the worksheet.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v23.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

void FreezeRows(
    int rowOffset
)

Parameters

Name Type Description
rowOffset Int32

An integer value that specifies the zero-based offset of the last row to be frozen relative to the first row in a worksheet.

Remarks

The FreezeRows method locks rows at the top of the worksheet, starting from the first row in the worksheet and ending with the row specified by rowOffset relative to the first row. Frozen rows are visible while the remaining area of the worksheet is scrolled.

To freeze worksheet columns, or to freeze both rows and columns, use the Worksheet.FreezeColumns or Worksheet.FreezePanes method.

To unfreeze panes in a worksheet, use the Worksheet.UnfreezePanes method.

The following example demonstrates how to use the FreezeRows method to freeze first four rows in a worksheet.

using DevExpress.Spreadsheet;
// ...

Worksheet worksheet = workbook.Worksheets[0];
worksheet.FreezeRows(3);

The following image shows the result of executing the code above. Rows from 1 through 4 are always visible. Other rows from 5 through the last row of the worksheet can be scrolled. The worksheet is fully scrollable horizontally, by columns.

SpreadsheetControl_Worksheet_FreezeRows

See Also