Freeze the pane starting at row 5:

var sheet = grid.CurrentWorksheet;
sheet.FreezeToCell(5, 0);

33

Get the current freeze position:

CellPosition pos = sheet.GetFreezePos();

A freeze position of (0,0) means there are no frozen rows or columns.

Check whether the current worksheet is frozen:

bool isFrozen = sheet.IsFrozen();

Freeze to specified position

ReoGrid supports freezing to a specified position (at one or two adjacent edges). The following positions are available:

  • Left
  • Top
  • Right
  • Bottom
  • Left and Top
  • Left and Bottom
  • Right and Top
  • Right and Bottom

85

Pass the third argument to freeze the worksheet at a specified position:

sheet.FreezeToCell(5, 5, FreezePosition.RightBottom);

Tip: More detailed freeze examples are available in the demo project.

Frozen region too large

If the frozen region is larger than the entire control, the active region will become invisible.

Two situations can result in an overly large frozen region:

  • A normal frozen region and an active region are specified, but the control is resized too small
  • A frozen region that is too large is specified

86

For example, if a grid has 100 rows and the maximum visible rows is 30, freezing to row 60 at the bottom requires 40 rows to be displayed in the frozen area — which exceeds the maximum visible region (30 rows) — causing the active region to become invisible.

Was this article helpful?