Back to Devexpress

Worksheet.FreezeRows(Int32) Method

officefileapi-devexpress-dot-spreadsheet-dot-worksheet-dot-freezerows-x28-system-dot-int32-x29.md

latest2.9 KB
Original Source

Worksheet.FreezeRows(Int32) Method

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

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void FreezeRows(
    int rowOffset
)
vb
Sub FreezeRows(
    rowOffset As Integer
)

Parameters

NameTypeDescription
rowOffsetInt32

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.

csharp
using DevExpress.Spreadsheet;
// ...

Worksheet worksheet = workbook.Worksheets[0];
worksheet.FreezeRows(3);
vb
Imports DevExpress.Spreadsheet
' ...

Dim worksheet As 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.

See Also

FreezeColumns

FreezePanes

UnfreezePanes()

Worksheet Interface

Worksheet Members

DevExpress.Spreadsheet Namespace