Skip to main content

WorksheetDisplayArea.SetSize(String, Int32, Int32) Method

Defines the number of visible columns and rows for the specified worksheet.

Namespace: DevExpress.Xpf.Spreadsheet

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

NuGet Package: DevExpress.Wpf.Spreadsheet

Declaration

public void SetSize(
    string worksheetName,
    int maxColumnCount,
    int maxRowCount
)

Parameters

Name Type Description
worksheetName String

A string specifying the name of the worksheet whose visible area should be restricted.

maxColumnCount Int32

An integer that is the maximum number of columns to be displayed in a worksheet. The value must be a whole number between 1 and 16,384.

maxRowCount Int32

An integer that is the maximum number of rows to be displayed in a worksheet. The value must be a whole number between 1 and 1,048,576.

Remarks

This example demonstrates how to display only 5 rows and 5 columns in a worksheet.

spreadsheetControl.WorksheetDisplayArea.SetSize("Sheet1", 5, 5);

The SetSize method restricts access to worksheet cells only in UI and does not affect API methods, so you can change the content and formatting of necessary cells in code.

To restore the restricted visible area to the default size with all rows and columns visible, use the Reset method.

See Also