New to Telerik Document ProcessingStart a free 30-day trial

Defines which operations users can perform on a protected worksheet, controlling row, column, cell, and filtering permissions.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Model.Protection

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public class WorksheetProtectionOptions

Inheritance: objectWorksheetProtectionOptions

Constructors

Initializes a new WorksheetProtectionOptions with specific permission flags for each operation type.

C#
public WorksheetProtectionOptions(bool allowDeleteRows = false, bool allowInsertRows = false, bool allowDeleteColumns = false, bool allowInsertColumns = false, bool allowFormatCells = false, bool allowFormatColumns = false, bool allowFormatRows = false, bool allowFiltering = false, bool allowSorting = false)
Parameters:allowDeleteRowsbool

The allow delete rows.

allowInsertRowsbool

The allow insert rows.

allowDeleteColumnsbool

The allow delete columns.

allowInsertColumnsbool

The allow insert columns.

allowFormatCellsbool

The allow format cells.

allowFormatColumnsbool

The allow format columns.

allowFormatRowsbool

The allow format rows.

allowFilteringbool

The allow use autofilter.

allowSortingbool

The allow sorting.

Fields

Default protection options that disallow all modifications (all permission flags set to false).

C#
public static readonly WorksheetProtectionOptions Default

Methods

Creates a copy of this protection options instance with identical permission flags.

C#
public WorksheetProtectionOptions Clone()
Returns:

WorksheetProtectionOptions

The cloned instance.

Compares all permission flags and returns true if all match the specified object.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with the current object.

Returns:

bool

True if the specified object is equal to the current object; otherwise, false.

Overrides: object.Equals(object)

Computes a hash code from all permission flags.

C#
public override int GetHashCode()
Returns:

int

A hash code for the current object.

Overrides: object.GetHashCode()

Properties

Gets whether users can delete columns when the worksheet is protected.

C#
public bool AllowDeleteColumns { get; }
Property Value:

The allow delete columns.

Gets whether users can delete rows when the worksheet is protected.

C#
public bool AllowDeleteRows { get; }
Property Value:

The allow delete rows.

Gets whether users can apply and modify autofilters when the worksheet is protected.

C#
public bool AllowFiltering { get; }
Property Value:

The allow filtering.

Gets whether users can format cells (fonts, colors, borders) when the worksheet is protected.

C#
public bool AllowFormatCells { get; }
Property Value:

The allow format cells.

Gets whether users can format columns (width, visibility, styles) when the worksheet is protected.

C#
public bool AllowFormatColumns { get; }
Property Value:

The allow format columns.

Gets whether users can format rows (height, visibility, styles) when the worksheet is protected.

C#
public bool AllowFormatRows { get; }
Property Value:

The allow format rows.

Gets whether users can insert new columns when the worksheet is protected.

C#
public bool AllowInsertColumns { get; }
Property Value:

The allow insert columns.

Gets whether users can insert new rows when the worksheet is protected.

C#
public bool AllowInsertRows { get; }
Property Value:

The allow insert rows.

Gets whether users can sort cell ranges when the worksheet is protected.

C#
public bool AllowSorting { get; }
Property Value:

The allow sorting.