Back to Devexpress

WorksheetDisplayArea.SetSize(String, Int32, Int32) Method

wpf-devexpress-dot-xpf-dot-spreadsheet-dot-worksheetdisplayarea-dot-setsize-x28-system-dot-string-system-dot-int32-system-dot-int32-x29.md

latest2.5 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Wpf.Spreadsheet

Declaration

csharp
public void SetSize(
    string worksheetName,
    int maxColumnCount,
    int maxRowCount
)
vb
Public Sub SetSize(
    worksheetName As String,
    maxColumnCount As Integer,
    maxRowCount As Integer
)

Parameters

NameTypeDescription
worksheetNameString

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.

csharp
spreadsheetControl.WorksheetDisplayArea.SetSize("Sheet1", 5, 5);
vb
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

WorksheetDisplayArea Class

WorksheetDisplayArea Members

DevExpress.Xpf.Spreadsheet Namespace