Back to Devexpress

SheetView.Zoom Property

officefileapi-devexpress-dot-spreadsheet-dot-sheetview.md

latest5.9 KB
Original Source

SheetView.Zoom Property

Returns or specifies the zoom percentage for a sheet.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
int Zoom { get; set; }
vb
Property Zoom As Integer

Property Value

TypeDescription
Int32

The zoom percentage.

|

Remarks

This example demonstrates how to zoom a worksheet view (Worksheet.ActiveView). To do this, set the WorksheetView.Zoom property to an integer value that specifies the required zoom factor for a worksheet view.

Note

To specify how a worksheet should be scaled when it is printed, use the WorksheetPrintOptions.Scale property of the object accessed via Worksheet.PrintOptions. Refer to the How to: Specify Print Settings document for details on how to specify print options for a worksheet.

View Example

csharp
// Zoom in the worksheet view. 
workbook.Worksheets[0].ActiveView.Zoom = 150;
vb
' Zoom in the worksheet view. 
workbook.Worksheets(0).ActiveView.Zoom = 150

The DocumentOptions.ZoomMode property specifies whether the zoom percentage applies to all worksheet views (WorksheetZoomMode.AllViews) or the current view only (WorksheetZoomMode.ActiveView).

Note

The WinForms, WPF and ASP.NET Spreadsheet controls can display the Normal worksheet view only.

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

winforms-spreadsheetcontrol-api-part1/CS/SpreadsheetControl/SpreadsheetActions/WorksheetActions.cs#L127

csharp
// Zoom in to the worksheet view.
workbook.Worksheets[0].ActiveView.Zoom = 150;
#endregion #WorksheetZoom

wpf-spreadsheetcontrol-api-part-1/CS/SpreadsheetControl_WPF_API/SpreadsheetActions/WorksheetActions.cs#L147

csharp
// Zoom in to the worksheet view.
workbook.Worksheets[0].ActiveView.Zoom = 150;
#endregion #WorksheetZoom

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

csharp
// Zoom in the worksheet view.
workbook.Worksheets[0].ActiveView.Zoom = 150;
#endregion #WorksheetZoom

winforms-spreadsheetcontrol-api-part1/VB/SpreadsheetControl/SpreadsheetActions/WorksheetActions.vb#L129

vb
' Zoom in to the worksheet view.
            workbook.Worksheets(0).ActiveView.Zoom = 150
' #End Region ' #WorksheetZoom

wpf-spreadsheetcontrol-api-part-1/VB/SpreadsheetControl_WPF_API/SpreadsheetActions/WorksheetActions.vb#L133

vb
' Zoom in to the worksheet view.
            workbook.Worksheets(0).ActiveView.Zoom = 150
' #End Region ' #WorksheetZoom

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

vb
' Zoom in the worksheet view.
            workbook.Worksheets(0).ActiveView.Zoom = 150
#End Region ' #WorksheetZoom

See Also

SheetView Interface

SheetView Members

DevExpress.Spreadsheet Namespace