Table of Contents

Class WorksheetPropertiesExtensions

Namespace
Openize.Cells
Assembly
Openize.OpenXMLSDK.dll

Provides extension methods for managing worksheet display properties and settings.

public static class WorksheetPropertiesExtensions
Inheritance
WorksheetPropertiesExtensions
Inherited Members

Methods

SetDefaultColumnWidth(Worksheet, double)

Sets the default column width for the worksheet.

public static Worksheet SetDefaultColumnWidth(this Worksheet worksheet, double width)

Parameters

worksheet Worksheet

The worksheet.

width double

The default column width in characters.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.

ArgumentOutOfRangeException

Thrown when width is not positive.

SetDefaultRowHeight(Worksheet, double)

Sets the default row height for the worksheet.

public static Worksheet SetDefaultRowHeight(this Worksheet worksheet, double height)

Parameters

worksheet Worksheet

The worksheet.

height double

The default row height in points.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.

ArgumentOutOfRangeException

Thrown when height is not positive.

SetRightToLeft(Worksheet, bool)

Sets whether the worksheet is displayed right-to-left.

public static Worksheet SetRightToLeft(this Worksheet worksheet, bool rightToLeft)

Parameters

worksheet Worksheet

The worksheet.

rightToLeft bool

True for right-to-left display; false for left-to-right display.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.

SetZoom(Worksheet, int)

Sets the zoom level for the worksheet view.

public static Worksheet SetZoom(this Worksheet worksheet, int zoomPercentage)

Parameters

worksheet Worksheet

The worksheet.

zoomPercentage int

The zoom percentage (10-400).

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.

ArgumentOutOfRangeException

Thrown when zoomPercentage is out of valid range (10-400).

ShowFormulas(Worksheet, bool)

Sets whether to show or hide formulas in the worksheet.

public static Worksheet ShowFormulas(this Worksheet worksheet, bool show)

Parameters

worksheet Worksheet

The worksheet.

show bool

True to show formulas; false to hide formulas.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.

ShowGridlines(Worksheet, bool)

Sets whether to show or hide gridlines in the worksheet.

public static Worksheet ShowGridlines(this Worksheet worksheet, bool show)

Parameters

worksheet Worksheet

The worksheet.

show bool

True to show gridlines; false to hide gridlines.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.

ShowRowColumnHeaders(Worksheet, bool)

Sets whether to show or hide row and column headers in the worksheet.

public static Worksheet ShowRowColumnHeaders(this Worksheet worksheet, bool show)

Parameters

worksheet Worksheet

The worksheet.

show bool

True to show headers; false to hide headers.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.

ShowZeroValues(Worksheet, bool)

Sets whether to show or hide zero values in the worksheet.

public static Worksheet ShowZeroValues(this Worksheet worksheet, bool show)

Parameters

worksheet Worksheet

The worksheet.

show bool

True to show zero values; false to hide zero values.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.