Skip to main content

IXlSheet.SplitPosition Property

Freezes a specific number of rows and columns above and to the left of the specified cell.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v24.2.Core.dll

Declaration

XlCellPosition SplitPosition { get; set; }

Property Value

Type Description
XlCellPosition

An XlCellPosition object specifying the position of a cell below the rows and to the right of the columns that should be frozen.

Remarks

Use the SplitPosition property to lock panes at the top and on the left side of the worksheet to keep the specified rows and columns visible when the remaining area of the worksheet is scrolled.

The example below demonstrates how to freeze the first two rows and columns “A”, “B” and “C” in a worksheet. To do this, set the SplitPosition property to an XlCellPosition instance that specifies a cell located at the intersection of the fourth column (whose zero-based index is 3) and the third row (with the index 2).

Important

If you create an XLSX document, specify the SplitPosition property before you start generating columns, rows and cells.

// Create a new worksheet.
using(IXlSheet sheet = document.CreateSheet()) 
{
    // Freeze visible rows and columns above and to the left of the cell D3. 
    sheet.SplitPosition = new XlCellPosition(3, 2);
}

The image below shows the result.

XlExport_Sheet_FrozenPanes

See Also