Class
WorksheetProtectionOptions

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:

cs-api-definition
public class WorksheetProtectionOptions

Inheritance: objectWorksheetProtectionOptions

Constructors

WorksheetProtectionOptions(bool, bool, bool, bool, bool, bool, bool, bool, bool)

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

Declaration

cs-api-definition
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

allowDeleteRows

bool

The allow delete rows.

allowInsertRows

bool

The allow insert rows.

allowDeleteColumns

bool

The allow delete columns.

allowInsertColumns

bool

The allow insert columns.

allowFormatCells

bool

The allow format cells.

allowFormatColumns

bool

The allow format columns.

allowFormatRows

bool

The allow format rows.

allowFiltering

bool

The allow use autofilter.

allowSorting

bool

The allow sorting.

Fields

Default

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

Declaration

cs-api-definition
public static readonly WorksheetProtectionOptions Default

Field Value

WorksheetProtectionOptions

Properties

AllowDeleteColumns

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

Declaration

cs-api-definition
public bool AllowDeleteColumns { get; }

Property Value

bool

The allow delete columns.

AllowDeleteRows

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

Declaration

cs-api-definition
public bool AllowDeleteRows { get; }

Property Value

bool

The allow delete rows.

AllowFiltering

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

Declaration

cs-api-definition
public bool AllowFiltering { get; }

Property Value

bool

The allow filtering.

AllowFormatCells

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

Declaration

cs-api-definition
public bool AllowFormatCells { get; }

Property Value

bool

The allow format cells.

AllowFormatColumns

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

Declaration

cs-api-definition
public bool AllowFormatColumns { get; }

Property Value

bool

The allow format columns.

AllowFormatRows

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

Declaration

cs-api-definition
public bool AllowFormatRows { get; }

Property Value

bool

The allow format rows.

AllowInsertColumns

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

Declaration

cs-api-definition
public bool AllowInsertColumns { get; }

Property Value

bool

The allow insert columns.

AllowInsertRows

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

Declaration

cs-api-definition
public bool AllowInsertRows { get; }

Property Value

bool

The allow insert rows.

AllowSorting

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

Declaration

cs-api-definition
public bool AllowSorting { get; }

Property Value

bool

The allow sorting.

Methods

Clone()

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

Declaration

cs-api-definition
public WorksheetProtectionOptions Clone()

Returns

WorksheetProtectionOptions

The cloned instance.

Equals(object)

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

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

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)

GetHashCode()

Computes a hash code from all permission flags.

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

A hash code for the current object.

Overrides object.GetHashCode()