Skip to main content
A newer version of this page is available. .
Row

Worksheet.Visible Property

Gets or sets whether the current worksheet is visible or hidden.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v18.2.Core.dll

Declaration

bool Visible { get; set; }

Property Value

Type Description
Boolean

true, if the worksheet is visible; otherwise, false.

Remarks

Use the Visible property to control the visibility of the worksheet. To hide and unhide a worksheet, you can also use the Worksheet.VisibilityType property. It allows you to mark a worksheet as “very hidden”. In this mode, the worksheet cannot be accessed by end-users.

If you hide a worksheet that is currently active, the next visible worksheet to the right of this worksheet is automatically activated. If there are no visible worksheets to the right of the hidden worksheet, the first visible worksheet to the left of this worksheet becomes active.

Note

A workbook must always contain at least one visible worksheet.

Example

This example demonstrates how to manage worksheet visibility in a workbook. To do this, use the following properties.

Note

A workbook must always contain at least one visible worksheet.

// Hide the worksheet under the "Sheet2" name and prevent end-users from unhiding it via user interface.
// To make this worksheet visible again, use the Worksheet.Visible property.
workbook.Worksheets["Sheet2"].VisibilityType = WorksheetVisibilityType.VeryHidden;

// Hide the "Sheet3" worksheet. 
// In this state a worksheet can be unhidden via user interface.
workbook.Worksheets["Sheet3"].Visible = false;

The following code snippets (auto-collected from DevExpress Examples) contain references to the Visible 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