Back to Devexpress

WorksheetView.ViewType Property

officefileapi-devexpress-dot-spreadsheet-dot-worksheetview.md

latest3.5 KB
Original Source

WorksheetView.ViewType Property

Gets or sets a view to display worksheet content.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
WorksheetViewType ViewType { get; set; }
vb
Property ViewType As WorksheetViewType

Property Value

TypeDescription
WorksheetViewType

A WorksheetViewType enumeration member.

|

Available values:

NameDescription
Normal

Worksheet content is displayed in the Normal view.

| | PageLayout |

Worksheet content is displayed in the Page Layout view.

| | PageBreakPreview |

Worksheet content is displayed in the Page Break Preview view.

|

Remarks

Use the ViewType property to specify which view should be used to display the worksheet content when the workbook is opened in Microsoft® Excel®.

The current versions of the WinForms, WPF and ASP.NET spreadsheet controls support the Normal worksheet view only.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ViewType 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.

spreadsheet-document-api-examples-part1/CS/SpreadsheetExamples/SpreadsheetActions/WorksheetActions.cs#L139

csharp
// Select the worksheet view type.
workbook.Worksheets[0].ActiveView.ViewType = WorksheetViewType.PageLayout;
#endregion #ViewType

spreadsheet-document-api-examples-part1/VB/SpreadsheetExamples/SpreadsheetActions/WorksheetActions.vb#L135

vb
' Select the worksheet view type.
            workbook.Worksheets(0).ActiveView.ViewType = WorksheetViewType.PageLayout
#End Region ' #ViewType

See Also

PrintOptions

How to: Specify Print Settings

WorksheetView Interface

WorksheetView Members

DevExpress.Spreadsheet Namespace