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.v21.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

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SplitPosition property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also